/* tournament.css */

:root {
    --text-primary: #e5e7eb;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-brd: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --info-gradient: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Tournament Hero Section */
.tournament-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-radius: 20px;
    padding: 50px 30px;
    margin-bottom: 40px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tournament-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08), transparent 70%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.tournament-status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    color: #fff;
    margin: 0;
    order: 1;
}

.tournament-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    order: 2;
}

.tournament-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0;
    order: 3;
}

.status-ongoing {
    background: var(--success-gradient);
    animation: pulse 2s infinite;
}

.status-pending {
    background: var(--info-gradient);
}

.status-completed {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 5px 30px rgba(16, 185, 129, 0.5);
    }
}

/* Admin Panel */
.admin-panel {
    border: 2px solid rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
}

.admin-title {
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.admin-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-brd);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    text-align: center;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 15px;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Content Sections */
.content-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-brd);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

/* Payment Section */
.payment-overview {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.payment-fee {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
}

.payment-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.payment-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-brd);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.payment-stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.payment-stat-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.payment-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
}

.payment-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Swish Payment */
.swish-info-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.swish-qr {
    width: 180px;
    height: 180px;
    border: 2px solid #10b981;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swish-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swish-details {
    flex: 1;
}

.swish-details h4 {
    color: #10b981;
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.swish-details p {
    margin: 6px 0;
    color: var(--text-muted);
    line-height: 1.4;
}

.swish-custom {
    margin-top: 12px;
}

.swish-custom label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.swish-input {
    width: 100%;
    max-width: 520px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    transition: border-color 0.3s ease;
}

.swish-input:focus {
    border-color: #10b981;
}

.swish-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.swish-help {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.swish-save {
    margin-top: 10px;
    margin-right: 10px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    background: var(--success-gradient);
    color: #fff;
    transition: all 0.3s ease;
}

.swish-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.swish-cta {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--success-gradient);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s ease;
}

.swish-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    color: #fff;
}

.payment-deadline {
    margin-top: 14px;
    font-size: 0.9rem;
}

.deadline-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
}

.payment-error {
    text-align: center;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    color: #ef4444;
}

.payment-error i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Teams Section */
.team-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.team-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-brd);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.team-card:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: inherit;
}

.team-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.team-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.team-logo-placeholder {
    background: var(--primary-gradient);
}

.team-info {
    flex: 1;
    min-width: 0;
}

.team-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 3px;
    word-break: break-word;
}

.team-captain {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-captain i {
    color: #fbbf24;
    font-size: 0.8rem;
}

.team-payment-wrapper {
    margin-top: 10px;
}

.team-payment-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.team-payment-status.paid {
    background: var(--success-gradient);
}

.team-payment-status.unpaid {
    background: var(--danger-gradient);
    animation: pulse 2s infinite;
}

.team-payment-status.no-payment {
    background: rgba(107, 114, 128, 0.3);
}

.team-stats {
    display: flex;
    gap: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.team-stat {
    flex: 1;
    text-align: center;
}

.team-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
}

.team-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Maps Section */
.map-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.map-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.map-card:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.map-card:hover .map-image {
    transform: scale(1.1);
}

.map-overlay {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 12px 10px;
}

.map-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

/* Matches Section */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-brd);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.match-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(10px);
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.match-team-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.match-vs {
    background: var(--primary-gradient);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 10px;
}

.match-status {
    font-weight: 600;
    text-transform: uppercase;
}

.match-status.live {
    color: #ef4444;
    animation: pulse 2s infinite;
}

/* Winner Section */
.winner-section {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border: 2px solid rgba(251, 191, 36, 0.3);
    text-align: center;
    padding: 40px;
}

.winner-icon {
    font-size: 4rem;
    color: #fbbf24;
    margin-bottom: 20px;
}

.winner-name {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.winner-subtitle {
    color: #fbbf24;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

/* Settings Content */
.settings-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    color: #e2e8f0;
    line-height: 1.8;
    font-family: Monaco, 'Courier New', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 30px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

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

.btn-success:hover {
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

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

.btn-info:hover {
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.btn-disabled {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: rgba(102, 126, 234, 0.3);
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 1.1rem;
}

/* Error Messages */
.error-message {
    background: var(--danger-gradient);
    color: #fff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tournament-hero {
        padding: 40px 20px;
    }
    
    .tournament-title {
        font-size: 2rem;
    }
    
    .tournament-status-badge {
        font-size: 0.75rem;
        padding: 6px 16px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .map-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .swish-info-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .swish-qr {
        width: 150px;
        height: 150px;
    }
    
    .match-teams {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-action {
        justify-content: center;
    }
    
    .payment-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .tournament-hero {
        padding: 40px 20px;
    }
    
    .tournament-title {
        font-size: 1.5rem;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .team-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .team-stats {
        justify-content: space-around;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}