@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --c1: rgba(0, 240, 255, 0.4);
    --c2: rgba(65, 105, 225, 0.4);
    --c3: rgba(255, 215, 0, 0.4);
    --c4: rgba(50, 205, 50, 0.4);
    --c5: rgba(147, 112, 219, 0.4);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=1920&q=80') center/cover fixed;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Changed to flex-start so it grows */
}

/* Background Overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 15, 30, 0.5);
    /* Darken the office background slightly */
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Main Container matching the giant glass panel in the image */
.main-glass-panel {
    width: 90%;
    max-width: 1300px;
    min-height: 85vh;
    /* Allow it to grow, no fixed height */
    margin: 40px 0;
    /* Add top and bottom margins */
    background: rgba(255, 255, 255, 0.05);
    /* Very subtle white */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 20px 30px;
    box-sizing: border-box;
}

/* Top Progress Bar Widget */
.top-progress-widget {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #e2e8f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.top-progress-widget i {
    color: #ffd700;
}

/* Header Navigation */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    color: #e2e8f0;
    transition: color 0.2s;
}

.nav-link i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.nav-link:hover {
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 15px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

/* Layout Columns */
.app-body {
    display: flex;
    gap: 30px;
    flex: 1;
    align-items: flex-start;
    /* Important to keep sidebars at top */
}

/* Left Sidebar (Rounded Buttons) */
.left-sidebar {
    width: 90px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: 30px;
}

.side-btn {
    width: 100%;
    aspect-ratio: 1;
    /* Square */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #fff;
    transition: background 0.2s, transform 0.2s;
}

.side-btn i {
    font-size: 1.5rem;
}

.side-btn span {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.side-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Center List (The giant colored glass cards) */
.center-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

.rank-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 90px;
    background: linear-gradient(90deg, var(--card-color) 0%, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0 20px;
    gap: 20px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.rank-card:hover {
    transform: scale(1.01);
    border-color: rgba(255, 255, 255, 0.3);
}

.rank-number {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    width: 60px;
}

.rank-dot {
    font-size: 3rem;
    color: var(--dot-color);
    margin-left: -5px;
    text-shadow: 0 0 10px var(--dot-color);
}

.rank-text {
    flex: 1;
}

.rank-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    /* Responsive limit */
}

.rank-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.rank-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.play-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn-play-pill {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 8px 30px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.2s;
}

.btn-play-pill:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.play-sub {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Right Sidebar (Widgets) */
.right-sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 30px;
}

.glass-widget {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.widget-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.widget-headline {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 15px;
}

.countdown-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 8px 0;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.btn-cyan {
    display: block;
    background: #00e5ff;
    color: #000;
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    transition: box-shadow 0.2s;
    border: none;
    width: 100%;
    cursor: pointer;
}

.btn-cyan:hover {
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.7);
}

.widget-input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    margin-bottom: 15px;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

.widget-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* Sidebar Games 2 Column Grid */
.sidebar-games-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sidebar-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    text-decoration: none;
    transition: transform 0.2s;
}

.sidebar-game-card:hover {
    transform: translateY(-2px);
}

.sidebar-game-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.sidebar-game-card span {
    font-size: 0.65rem;
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.2;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom Footer Bar inside main panel */
.bottom-bar {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.students-widget {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-stack {
    display: flex;
}

.avatar-stack img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin-left: -12px;
}

.avatar-stack img:first-child {
    margin-left: 0;
}

.students-text {
    font-size: 0.75rem;
    line-height: 1.2;
}

.students-text b {
    color: #00e5ff;
    font-weight: 600;
    display: block;
}

.btn-start-games {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.btn-start-games:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Beautiful Tag Container */
.seo-tags-beautiful {
    margin-top: 40px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    /* Scrollable tags */
    align-items: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.seo-tags-beautiful::-webkit-scrollbar {
    width: 8px;
}

.seo-tags-beautiful::-webkit-scrollbar-track {
    background: transparent;
}

.seo-tags-beautiful::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}

.seo-tags-beautiful::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.6);
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: rgba(0, 240, 255, 0.2);
    color: #fff;
    border-color: rgba(0, 240, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 240, 255, 0.2);
}

/* View.php specific tweaks */
.view-window {
    width: 90%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05);
    /* very frosted */
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

.game-iframe-wrapper {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: center;
}

.banner-slot {
    width: 350px;
    height: 250px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.iframe-container {
    flex: 1;
    height: 100%;
    min-height: 500px;
    border-radius: 10px;
    overflow: hidden;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Mobile Adjustments */
@media (max-width: 1200px) {
    .app-body {
        flex-direction: column;
        align-items: stretch;
    }

    .left-sidebar {
        width: 100%;
        flex-direction: row;
        position: static;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .side-btn {
        width: 90px;
        flex-shrink: 0;
    }

    .right-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .glass-widget {
        flex: 1;
        min-width: 250px;
    }

    .view-content-wrapper {
        flex-direction: column;
    }

    .view-side-column {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ad-box {
        flex: 1;
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .main-glass-panel {
        width: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        padding: 15px;
    }

    .app-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-bar {
        width: 100%;
        max-width: 200px;
    }

    .bottom-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .rank-card {
        flex-direction: column;
        height: auto;
        padding: 20px;
        text-align: center;
        background: var(--card-color);
        gap: 10px;
    }

    .rank-number {
        width: auto;
        font-size: 2.5rem;
    }

    .rank-dot {
        display: none;
    }

    .rank-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .play-action {
        width: 100%;
    }

    .btn-play-pill {
        width: 100%;
        justify-content: center;
    }

    .top-progress-widget {
        position: static;
        transform: none;
        width: 100%;
        margin-bottom: 20px;
        box-sizing: border-box;
        text-align: center;
        justify-content: center;
    }

    .ad-box {
        min-width: 100%;
    }
}