* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #e31e24;
    --dark-red: #b71c1c;
    --dark-gray: #2d2d2d;
    --medium-gray: #4a4a4a;
    --light-gray: #6b6b6b;
    --bg-light: #fafafa;
    --white: #ffffff;
    --border: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 40px;
    width: auto;
}

.brand-text h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--light-gray);
    font-weight: 500;
}

.btn-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-light);
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-home:hover {
    background: var(--primary-red);
    color: var(--white);
}

.btn-home i {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Section */
.section {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    color: var(--dark-gray);
    font-weight: 700;
}

.section-header h3 i {
    width: 24px;
    height: 24px;
    color: var(--primary-red);
}

/* Match Input */
.match-input-container {
    max-width: 600px;
}

.input-group {
    display: flex;
    gap: 15px;
}

.input-field {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.input-field::placeholder {
    color: var(--light-gray);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-red);
}

.btn-secondary {
    background: var(--medium-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-gray);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: var(--warning);
    color: var(--dark-gray);
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn-info:hover {
    background: #138496;
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Match Badge */
.match-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.1), rgba(227, 30, 36, 0.05));
    border: 1px solid rgba(227, 30, 36, 0.2);
    border-radius: 50px;
    color: var(--primary-red);
    font-size: 0.9rem;
    font-weight: 600;
}

/* URLs Container */
.urls-container {
    display: grid;
    gap: 12px;
}

.url-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.url-item:hover {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-sm);
}

.url-info {
    flex: 1;
}

.url-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 4px;
}

.url-path {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--light-gray);
    word-break: break-all;
}

.btn-copy {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Players Grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.team-column {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--border);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.team-header h4 {
    font-size: 1.2rem;
    color: var(--dark-gray);
    font-weight: 700;
}

.team-badge {
    padding: 4px 12px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.team-badge.away {
    background: var(--medium-gray);
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-card:hover {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.player-card.selected {
    border-color: var(--primary-red);
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.05), rgba(227, 30, 36, 0.02));
    box-shadow: var(--shadow-md);
}

.player-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-number {
    width: 40px;
    height: 40px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.player-card.selected .player-number {
    background: var(--dark-red);
}

.player-name {
    font-weight: 600;
    color: var(--dark-gray);
}

.player-card i {
    width: 20px;
    height: 20px;
    color: var(--light-gray);
}

.player-card.selected i {
    color: var(--primary-red);
}

/* Selected Player Card */
.selected-player-card {
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.05), rgba(227, 30, 36, 0.02));
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    padding: 25px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.player-avatar {
    width: 70px;
    height: 70px;
    background: var(--primary-red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar i {
    width: 36px;
    height: 36px;
    color: var(--white);
}

.player-details h4 {
    font-size: 1.4rem;
    color: var(--dark-gray);
    margin-bottom: 5px;
}

.player-details p {
    color: var(--light-gray);
}

.player-urls {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: var(--white);
    border-left: 4px solid;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

.toast i {
    width: 20px;
    height: 20px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.info i {
    color: var(--info);
}

.toast-message {
    flex: 1;
    color: var(--dark-gray);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--white);
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .players-grid {
        grid-template-columns: 1fr;
    }

    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .input-group {
        flex-direction: column;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .url-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 20px 15px;
    }

    .logo {
        height: 30px;
    }

    .brand-text h2 {
        font-size: 1rem;
    }
}