@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@400;600;700;800&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #ec4899;
}

body {
    font-family: 'Anuphan', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    background-image: radial-gradient(circle at 50% -20%, #1e293b, #0f172a 70%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}
a:hover {
    color: var(--text-main);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
}
.navbar .logo span {
    color: var(--primary);
}
.navbar .logo img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.nav-links a {
    margin-left: 30px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
}
.nav-links a:hover {
    color: var(--primary);
}
.nav-links a.btn-admin {
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    font-family: 'Anuphan', sans-serif;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: all 0.3s ease;
}
.nav-links a.btn-admin:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
    transform: translateY(-2px);
    color: white;
}

.hero {
    text-align: center;
    padding: 40px 20px 20px 20px;
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1; /* For sticky footer */
    width: 100%;
    box-sizing: border-box;
}

.narrow-container {
    max-width: 1000px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 80px;
}

.list-view {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-bottom: 80px;
}
.list-view .card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.list-view .card-img {
    width: 280px;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.list-view .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.list-view .btn-primary {
    width: auto;
    align-self: flex-start;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px !important;
    }
    .navbar .logo {
        font-size: 16px !important;
        gap: 5px !important;
    }
    .navbar .logo img {
        height: 30px !important;
    }
    .nav-links {
        gap: 8px !important;
    }
    .nav-links a {
        font-size: 13px;
        margin-left: 10px;
    }
    .nav-logout-btn {
        display: none !important;
    }
    .nav-user-container {
        padding: 5px !important;
        gap: 5px !important;
    }
    .nav-links a.btn-primary, .nav-links .btn-primary {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    .hero h1 {
        font-size: 24px !important;
    }
    .hero p {
        font-size: 14px !important;
    }
    .section-title {
        font-size: 20px !important;
    }
    .list-view .card {
        flex-direction: column;
    }
    .list-view .card-img {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 16;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    /* Detail Page Mobile */
    .detail-header {
        height: 280px !important;
        margin-top: 20px !important;
    }
    .detail-title-wrapper {
        padding: 20px !important;
    }
    .detail-title-wrapper h1 {
        font-size: 20px !important;
    }
    .detail-content {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }
    .detail-content > div {
        min-width: 0;
    }
    .detail-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        padding-bottom: 10px !important;
    }
    .detail-tabs .tab-btn {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
    .teams-grid {
        grid-template-columns: 1fr !important;
    }
    .desktop-only-divider {
        display: none !important;
    }
    .back-text-desktop {
        display: none !important;
    }
    .back-text-mobile {
        display: inline !important;
    }
    .mobile-apply-btn {
        display: block !important;
        margin-bottom: 20px;
    }
    .desktop-apply-btn {
        display: none !important;
    }
    body:not(.tab-info-active) .sidebar-box {
        display: none !important;
    }
    
    /* Schedule Tab Mobile Adjustments */
    .schedule-container {
        padding: 10px !important;
    }
    
    .match-row {
        padding: 12px !important;
        gap: 8px !important;
    }
    .match-team-name {
        font-size: 14px !important;
    }
    .match-score-bubble {
        font-size: 14px !important;
        padding: 4px 12px !important;
        min-width: 60px !important;
    }
    
    .group-match-row {
        padding: 10px !important;
        gap: 8px !important;
    }
    .group-match-team {
        font-size: 13px !important;
    }
    .group-match-score {
        font-size: 13px !important;
        padding: 4px 10px !important;
        min-width: 50px !important;
    }
    
    .champion-title {
        font-size: 24px !important;
    }
    .champion-team-name {
        font-size: 32px !important;
    }
}
.mobile-apply-btn {
    display: none;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: rgba(56, 189, 248, 0.3);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.card-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 15px;
    color: #cbd5e1;
    margin-bottom: 25px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Anuphan', sans-serif;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
    transform: translateY(-2px);
}
.btn-primary:active {
    transform: scale(0.96) translateY(0);
}

/* Detail Page Styles */
.detail-header {
    margin-top: 40px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 400px;
    display: flex;
    align-items: flex-end;
}
.detail-cover {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
}
.detail-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, #0f172a 10%, transparent 100%);
    z-index: -1;
}
.detail-title-wrapper {
    padding: 40px;
    width: 100%;
}
.detail-title-wrapper h1 {
    font-size: 42px;
    margin: 0 0 10px 0;
}

.detail-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 20px;
    padding-bottom: 80px;
}

.detail-tabs {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}
.detail-tabs .tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Anuphan', sans-serif;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.detail-tabs .tab-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.detail-tabs .tab-btn.active {
    background: #d9f99d; /* light green from mockup */
    color: #1e293b;
}

.sidebar-box {
    background: white; /* Match mockup card */
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
    color: #1e293b;
}
.sidebar-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #1e293b;
}
.sidebar-box .meta-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e2e8f0;
}
.sidebar-box .meta-item:last-of-type {
    border-bottom: none;
}
.sidebar-box .meta-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 5px;
    display: block;
}
.sidebar-box .meta-value {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}
.team-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}
.team-slots .slot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.btn-create-team {
    background: #c5f06c;
    color: #1e293b;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Anuphan', sans-serif;
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}
.btn-create-team:hover {
    filter: brightness(0.9);
}

.detail-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 30px;
}
.detail-section h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}
.detail-section p, .detail-section li {
    color: #cbd5e1;
    font-size: 16px;
}



.btn-line {
    background: linear-gradient(135deg, #00c300 0%, #009900 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 195, 0, 0.4);
}
.btn-line:hover {
    background: linear-gradient(135deg, #00a500 0%, #008000 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 195, 0, 0.6);
}
.btn-line img, .btn-line svg {
    width: 24px;
    height: 24px;
}

/* Frontend Footer */
.frontend-footer {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin-top: auto;
}
.frontend-footer a {
    color: var(--primary);
    margin: 0 15px;
    font-weight: 600;
}

/* Stats Counters */
.stats-wrapper {
    max-width: 400px;
}
.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon i {
    font-size: 18px;
}
.online-dot {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 12px;
    height: 12px;
    background: #fbbf24;
    border-radius: 50%;
    border: 2px solid #059669;
}
.stat-label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
}
.stat-value {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
}
.stat-unit {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

@media (max-width: 768px) {
    .stats-wrapper {
        padding: 15px 10px !important;
        gap: 15px !important;
        max-width: 300px;
    }
    .stat-item {
        flex-direction: column;
        justify-content: center !important;
        text-align: center;
        gap: 8px !important;
    }
    .stat-item > div {
        text-align: center !important;
    }
    .stat-icon {
        width: 35px;
        height: 35px;
    }
    .stat-icon i {
        font-size: 14px;
    }
    .online-dot {
        width: 10px;
        height: 10px;
    }
    .stat-value {
        font-size: 16px;
    }
    .stat-label {
        font-size: 11px;
    }
}
