/* ===== CSS Variables ===== */
:root {
    --navy-blue: #001f54;
    --gold: #ffd700;
    --light-blue: #e6f2ff;
    --dark-gray: #2c3e50;
    --green: #2ecc71;
    --red: #e74c3c;
    --white: #ffffff;
    --shadow: rgba(0, 31, 84, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-gray);
    overflow-x: hidden;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--gold);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.logo {
    height: 50px;
    /* Ð£Ð²ÐµÐ»Ð¸Ñ‡ÑŒ Ñ 30px Ð´Ð¾ 50px */
    width: auto;
    object-fit: contain;
}

.stats-container {
    display: flex;
    gap: 3rem;
}

.stat-item {
    text-align: right;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--dark-gray);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy-blue);
    margin-top: 0.25rem;
}

.stat-value.secondary {
    font-size: 1.125rem;
    color: var(--dark-gray);
}

/* ===== Main Game Container ===== */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Study Button Section ===== */
.study-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

.study-button {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-gold);
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.study-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.study-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(245, 87, 108, 0.5);
}

.study-button:active {
    transform: scale(0.95);
}

.study-button:active::before {
    width: 300px;
    height: 300px;
}

.study-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.click-power {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--white);
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Tabs Navigation ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    min-width: 150px;
    padding: 1rem 1.5rem;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.tab.active {
    background: var(--white);
    color: var(--navy-blue);
    box-shadow: 0 4px 20px var(--shadow);
}

.tab-icon {
    font-size: 1.5rem;
}

/* ===== Content Panel ===== */
.content-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    min-height: 500px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.content-panel::-webkit-scrollbar {
    width: 10px;
}

.content-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.content-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.content-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Buildings Grid (Students/Teachers) ===== */
.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.building-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.building-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.building-card.affordable {
    border-color: var(--green);
}

.building-card.owned {
    border-color: var(--gold);
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.building-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy-blue);
}

.building-count {
    background: var(--navy-blue);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.building-desc {
    font-size: 0.875rem;
    color: var(--dark-gray);
    opacity: 0.8;
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

.building-button {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--dark-gray);
    color: var(--white);
}

.building-button.affordable {
    background: var(--green);
}

.building-button:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.building-button:active:not(:disabled) {
    transform: scale(0.98);
}

/* ===== Buildings List (Facilities/Upgrades) ===== */
.buildings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.list-item:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.list-item.affordable {
    border-color: var(--green);
}

.list-item.owned {
    border-color: var(--gold);
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-blue);
    margin-bottom: 0.5rem;
}

.list-item-desc {
    font-size: 0.875rem;
    color: var(--dark-gray);
    opacity: 0.8;
}

.list-item-button {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--dark-gray);
    color: var(--white);
    white-space: nowrap;
}

.list-item-button.affordable {
    background: var(--green);
}

.list-item-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.list-item-status {
    padding: 0.875rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--green);
}

/* ===== Graduate Button ===== */
.graduate-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1.25rem 2.5rem;
    border: none;
    border-radius: 50px;
    background: var(--gradient-gold);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.graduate-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(245, 87, 108, 0.6);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===== Floating Numbers ===== */
.floating-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.floating-number {
    position: absolute;
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: float 1s ease-out forwards;
    pointer-events: none;
}

@keyframes float {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px);
    }
}

/* ===== Achievement Popup ===== */
.achievement-popup {
    position: fixed;
    top: 120px;
    right: 2rem;
    background: var(--navy-blue);
    border: 3px solid var(--gold);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 400px;
    animation: slideIn 0.5s ease;
    z-index: 1001;
}

.achievement-popup.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(500px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-icon {
    font-size: 3rem;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 0.875rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 1.25rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.achievement-desc {
    font-size: 0.875rem;
    color: var(--light-blue);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--navy-blue);
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.125rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.offline-iq {
    font-size: 3rem;
    font-weight: 800;
    color: var(--green);
    margin: 1.5rem 0;
}

.modal-button {
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        text-align: center;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        min-width: 100%;
    }

    .buildings-grid {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-item-button,
    .list-item-status {
        width: 100%;
        text-align: center;
    }

    .graduate-button {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
    }

    .achievement-popup {
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
    }
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy-blue);
    margin-top: 0.25rem;
}

.stat-value.secondary {
    font-size: 1.125rem;
    color: var(--dark-gray);
}

.copyright {
    text-align: right;
    padding-left: 2rem;
}

.copyright-text {
    font-size: 0.75rem;
    color: var(--dark-gray);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.copyright-name {
    font-size: 1rem;
}

.achievement-icon {
    font-size: 3rem;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 0.875rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 1.25rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.achievement-desc {
    font-size: 0.875rem;
    color: var(--light-blue);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--navy-blue);
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.125rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.offline-iq {
    font-size: 3rem;
    font-weight: 800;
    color: var(--green);
    margin: 1.5rem 0;
}

.modal-button {
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        text-align: center;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        min-width: 100%;
    }

    .buildings-grid {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-item-button,
    .list-item-status {
        width: 100%;
        text-align: center;
    }

    .graduate-button {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
    }

    .achievement-popup {
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
    }
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy-blue);
    margin-top: 0.25rem;
}

.stat-value.secondary {
    font-size: 1.125rem;
    color: var(--dark-gray);
}

.copyright {
    text-align: right;
    padding-left: 2rem;
}

.copyright-text {
    font-size: 0.75rem;
    color: var(--dark-gray);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.copyright-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-blue);
    margin-top: 0.25rem;
}

.copyright-class {
    font-size: 0.875rem;
    color: var(--gold);
    font-weight: 600;
    margin-top: 0.125rem;
}

/* ===== Animations ===== */
.pulse {
    animation: pulse-text 0.1s ease-out;
}

@keyframes pulse-text {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        color: var(--green);
    }

    100% {
        transform: scale(1);
    }
}