@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary-color: #60a5fa;
    --background-color: #0f172a;
    /* Deeper dark blue-gray */
    --card-bg: rgba(30, 41, 59, 0.7);
    /* Glassy base */
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* --- PREMIUM / GOLD STYLES --- */
.text-gold {
    background: linear-gradient(135deg, #fbf2c0 0%, #facc15 50%, #b45309 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.3);
    font-weight: 800;
}

.text-teacher {
    background: linear-gradient(135deg, #fecaca 0%, #ef4444 50%, #991b1b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
    font-weight: 800;
    animation: teacherGlow 2s ease-in-out infinite alternate;
}

@keyframes teacherGlow {
    from {
        text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    }

    to {
        text-shadow: 0 0 35px rgba(239, 68, 68, 0.8);
    }
}

.auth-premium-badge {
    background: linear-gradient(135deg, #fbf2c0 0%, #facc15 50%, #b45309 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-premium-badge::before {
    content: '👑';
    font-size: 1.1rem;
    -webkit-text-fill-color: initial;
}

.btn-premium-gold {
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
    color: #451a03;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-premium-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fef3c7 0%, #d97706 100%);
    color: #451a03;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* --- GLOBAL SCROLLBAR REDESIGN --- */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    border: 4px solid var(--background-color);
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    border: 3px solid var(--background-color);
    background-clip: content-box;
}

/* --- NEW HEADER (Premium Redesign) --- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.7);
    /* Darker, more premium base */
    backdrop-filter: blur(20px);
    /* Stronger frost effect */
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0;
    /* Slightly more breathing room */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

nav.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    /* Wider container for modern look */
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-self: end;
    margin-right: 1rem;
    transition: transform 0.3s;
}

.nav-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.nav-logo img {
    height: 55px;
    /* Slightly smaller for elegance */
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    /* Tighter gap for continuous feel */
    list-style: none;
    background: rgba(255, 255, 255, 0.03);
    /* Very subtle fill */
    padding: 0.35rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Inset depth */
}

.nav-menu li a {
    text-decoration: none;
    color: var(--text-muted);
    /* Muted by default */
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: block;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.nav-menu li a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-menu li a.active-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: translateY(-1px);
}

/* Remove old underline style for active link since we use pills now */
.active-link::after {
    display: none;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-self: end;
    /* Push to far right */
    margin-left: 0;
    position: static;
    /* Remove absolute positioning */
}

/* --- LOGIN PAGE STYLES --- */
body.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(17, 24, 39, 0) 60%);
    z-index: -1;
    pointer-events: none;
}

.login-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin: 0;
    max-width: none;
}

.login-card {
    background: rgba(31, 41, 55, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.6);
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(17, 24, 39, 0.8);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 99px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #60a5fa, #818cf8);
}

/* Force rounded corners in navbar */
.nav-auth .btn-primary {
    border-radius: 99px !important;
}

main {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* --- SUPER HERO SECTION --- */
.hero-section {
    text-align: center;
    padding: 8rem 1rem 6rem 1rem;
    position: relative;
    overflow: visible;
    /* Changed from hidden to allow search dropdown to overflow */
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
    /* Taller hero */
    justify-content: center;
}

/* Background glow effect */
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(17, 24, 39, 0) 60%);
    z-index: -1;
    pointer-events: none;
}

.hero-title-large {
    font-size: clamp(3.5rem, 6vw, 5rem);
    /* Huge responsive text */
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    position: relative;
    z-index: 2;
    text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.35rem;
    max-width: 700px;
    margin: 0 auto 3.5rem auto;
    line-height: 1.6;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

/* Floating Decorations */
.floating-item {
    position: absolute;
    width: clamp(60px, 10vw, 120px);
    opacity: 0.15;
    filter: blur(2px);
    z-index: 1;
    animation: floatAnim 6s ease-in-out infinite;
    pointer-events: none;
}

.float-1 {
    top: 15%;
    left: 10%;
    animation-delay: -1s;
    width: 140px;
}

.float-2 {
    top: 20%;
    right: 15%;
    animation-delay: -3s;
    width: 100px;
}

.float-3 {
    bottom: 25%;
    left: 15%;
    animation-delay: -5s;
    width: 80px;
}

.float-4 {
    bottom: 30%;
    right: 10%;
    animation-delay: -2s;
    width: 120px;
}

@keyframes floatAnim {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Large Search "Island" */
.hero-search-wrapper.large-search {
    max-width: 650px;
    margin: 0 auto 3rem auto;
    position: relative;
    z-index: 10;
}

.hero-search-wrapper.large-search .hero-search-input {
    padding: 1.25rem 1.75rem;
    padding-right: 4rem;
    font-size: 1.2rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.hero-search-wrapper.large-search .hero-search-input:focus {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* --- LIVE SEARCH DROPDOWN --- */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    /* Custom Scrollbar for Search */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    /* Hidden by default */
    text-align: left;
}

.search-results-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item.private {
    border-left: 3px solid #d97706;
    background: linear-gradient(to right, rgba(217, 119, 6, 0.1), transparent);
}

.search-result-item.private:hover {
    background: linear-gradient(to right, rgba(217, 119, 6, 0.2), rgba(255, 255, 255, 0.05));
}

.search-result-item.vut {
    border-left: 3px solid #ef4444 !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.15), transparent) !important;
}

.search-result-item.vut:hover {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.25), rgba(255, 255, 255, 0.05)) !important;
}


.result-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.result-info {
    flex-grow: 1;
}

.result-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.result-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- HERO BUTTONS REDESIGN --- */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
}

.btn-hero {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-weight: 700;
    border-radius: 99px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    cursor: pointer;
    letter-spacing: -0.2px;
}

.btn-hero.big-btn {
    padding: 1.1rem 2.8rem;
    font-size: 1.1rem;
}

.btn-hero:hover .card-glow {
    opacity: 1;
    transform: scale(1.1);
}

.btn-hero.primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-hero.primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 15px 35px -5px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #60a5fa, #818cf8);
}

.btn-hero.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-hero.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-hero span {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.btn-hero:hover span {
    transform: scale(1.2) rotate(10deg);
}

/* Spacer for layout */
.spacer {
    height: 4rem;
}

/* Updated Section Headers */
.content-wrapper {
    margin-bottom: 2rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title .icon {
    font-size: 1.5rem;
}

.show-more-link .arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.show-more-link:hover .arrow {
    transform: translateX(4px);
}

footer {
    text-align: center;
    padding: 4rem 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-muted);
}

/* --- SCHOOL TABS (CARDS) --- */
.school-tabs-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
    width: 100%;
}

.school-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0;
    /* Remove padding to let image fill */
    border-radius: 20px;
    color: var(--text-color);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.5rem;

    display: flex;
    flex-direction: column;
    /* Stack image and text */
    align-items: center;

    width: 100%;
    /* Fill grid cell */
    overflow: hidden;
    /* Clip image corners */
    position: relative;
    text-align: center;
}

.school-tab-icon {
    width: 100%;
    height: 180px;
    /* Big photo height */
    object-fit: cover;
    border-radius: 0;
    /* Full width, no round corners inside */
    filter: brightness(0.8);
    transition: filter 0.3s ease, transform 0.5s ease;
}

.school-tab-icon-all {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    filter: brightness(0.9);
    transition: filter 0.3s ease, transform 0.5s ease;
}

.school-tab:hover .school-tab-icon-all {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.school-tab span {
    padding: 1.5rem;
    z-index: 1;
}

.read-more-btn {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.post-card:hover .read-more-btn {
    opacity: 1;
    transform: translateY(0);
}

/* --- LANDING PAGE EXTENSION SECTIONS --- */

.landing-extension {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 3rem;
    padding: 0 1rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Timeline Section */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 4rem auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color), #f59e0b);
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.timeline-item {
    display: flex;
    justify-content: flex-end;
    padding-right: 50%;
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
}

.timeline-item.right {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 50%;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 20px;
    height: 20px;
    background: #111827;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 10px var(--primary-color);
}

.timeline-item.right .timeline-dot {
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
}

.timeline-item:last-child .timeline-dot {
    border-color: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.timeline-card {
    background: rgba(31, 41, 55, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    margin: 0 40px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-card:hover {
    transform: scale(1.03);
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.timeline-item.right .timeline-card {
    border-left: 3px solid var(--secondary-color);
}

.timeline-item:not(.right) .timeline-card {
    border-right: 3px solid var(--primary-color);
    text-align: right;
}

.timeline-item.highlight .timeline-card {
    border: 1px solid #f59e0b;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.4), rgba(245, 158, 11, 0.05));
}

.timeline-card h3 {
    margin-bottom: 1rem;
    color: white;
}

.timeline-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.timeline-item:not(.right) .card-icon {
    margin-left: auto;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(31, 41, 55, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(31, 41, 55, 0.6);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Milestones Section */
.milestones-card {
    background: rgba(31, 41, 55, 0.4);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.milestone-year {
    font-weight: 800;
    color: white;
    font-size: 1.2rem;
}

.milestone-desc {
    color: var(--text-muted);
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.faq-item {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    color: white;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.03);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    background: rgba(0, 0, 0, 0.2);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-item.active .faq-question span {
    transform: rotate(45deg);
}

/* CTA Section */
.cta-section {
    margin-bottom: 6rem;
}

.cta-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    padding: 4rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.cta-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.telegram-btn {
    background: #0088cc !important;
    border: none !important;
    border-radius: 99px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0.8rem 2.2rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 136, 204, 0.3);
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.telegram-btn:hover {
    background: #0099ee !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 136, 204, 0.4);
}

@media (max-width: 768px) {
    .timeline-line {
        left: 30px;
    }

    .timeline-item {
        padding-left: 70px !important;
        padding-right: 20px !important;
        justify-content: flex-start !important;
    }

    .timeline-dot {
        left: 30px;
    }

    .timeline-card {
        margin: 0 !important;
        text-align: left !important;
        width: 100%;
        max-width: none;
    }

    .timeline-item:not(.right) .card-icon {
        margin-left: 0;
    }

    .cta-card {
        flex-direction: column;
        text-align: center;
        padding: 3rem 2rem;
    }

    .cta-actions {
        width: 100%;
        flex-direction: column;
    }
}

.school-tab:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.school-tab:hover .school-tab-icon {
    filter: brightness(1);
    transform: scale(1.05);
}

.school-tab.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color), 0 15px 30px rgba(37, 99, 235, 0.2);
}

.school-tab.active span {
    color: var(--primary-color);
}

/* Red Style for VUT (Teacher Only) */
.school-tab.school-tab-vut,
.school-tab[data-school="VUT"] {
    border-color: #ef4444 !important;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.4), rgba(31, 41, 55, 0.4)) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

.school-tab.school-tab-vut:hover,
.school-tab[data-school="VUT"]:hover {
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.35) !important;
    border-color: #f87171 !important;
    background: rgba(69, 10, 10, 0.5) !important;
    transform: translateY(-5px) !important;
}

.school-tab.school-tab-vut.active,
.school-tab[data-school="VUT"].active {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.3), rgba(31, 41, 55, 0.3)) !important;
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px #f87171, 0 15px 30px rgba(239, 68, 68, 0.4) !important;
}

.school-tab.school-tab-vut.active span,
.school-tab[data-school="VUT"].active span {
    color: #f87171 !important;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

/* Red Style for VUT Cards */
.file-card.vut-card {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, rgba(69, 10, 10, 0.5), rgba(31, 41, 55, 0.7)) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3) !important;
}

.file-card.vut-card:hover {
    border-color: #f87171 !important;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.5) !important;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.6), rgba(31, 41, 55, 0.9)) !important;
    transform: translateY(-8px) scale(1.03) !important;
}

.file-card.vut-card .file-name {
    color: #fecaca !important;
}

.file-card.vut-card .subject-badge {
    background-color: rgba(239, 68, 68, 0.25) !important;
    color: #fecaca !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    border-radius: 99px !important;
}

.file-card.vut-card .tag-badge {
    background-color: rgba(239, 68, 68, 0.25) !important;
    color: #fecaca !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

.file-card.vut-card .file-icon {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7)) !important;
    color: #f87171 !important;
}



/* Pagination Button */
.btn-load-more {
    display: block;
    margin: 3rem auto;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 99px;
    /* ROUND PILL */
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-load-more:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.btn-load-more:active {
    transform: translateY(0);
}

.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 2rem;
}

.materials-nav-section {
    margin-bottom: 5rem;
}

/* --- MATERIALS LAYOUT --- */
.materials-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    align-items: start;
    margin-bottom: 6rem;
}

.sidebar-wrapper {
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    color: var(--text-color);
}

.materials-sidebar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 6px;
    /* Create a gap between outer border and inner content */
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 140px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Move scrolling to inner container */
.filters-container {
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    /* Firefox Support */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Custom Scrollbar for Inner Container */
.filters-container::-webkit-scrollbar {
    width: 6px;
}

.filters-container::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px;
}

.filters-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.filters-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* --- FILTERS (Sidebar List) --- */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem 0.75rem 2rem 0.75rem;
    scrollbar-gutter: stable;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.8rem;
    border-radius: 16px;
    width: 100%;
    min-height: 54px;

    height: auto;

    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;

    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    overflow: visible;
    text-align: left;
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.filter-btn span {
    text-align: left;
    flex-grow: 1;
    white-space: normal;
    overflow: visible;
    padding: 0;
    font-size: 1rem;
    line-height: 1.3;
    display: block;
    word-break: break-word;
    /* Allow breaking long words if needed */
}

.filter-btn:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(10px);
    font-weight: 700;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.filter-btn.active span {
    color: var(--primary-color);
}

.filter-icon {
    width: 44px;
    /* Larger icons */
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    object-fit: cover;
    border-radius: 10px;
    background-color: #374151;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transition: border-color 0.3s;
}

.filter-btn.active .filter-icon {
    border-color: var(--primary-color);
}

/* Private Filter Button (Premium Gold - Balanced) */
.filter-btn.private-filter {
    border: 2px solid #d97706;
    border-left: 4px solid #fbbf24;
    background: linear-gradient(90deg, rgba(146, 64, 14, 0.2), rgba(31, 41, 55, 0.2));
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.15);
    color: #fbbf24;
}

.filter-btn.private-filter:hover {
    transform: translateX(8px);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.25);
    border-color: #fbbf24;
    background: linear-gradient(90deg, rgba(146, 64, 14, 0.3), rgba(31, 41, 55, 0.3));
}

.filter-btn.private-filter span {
    color: #fbbf24;
    /* Removed text shadow */
}

.filter-btn.private-filter .filter-icon {
    border: 1px solid rgba(251, 191, 36, 0.3);
    /* Removed icon shadow */
}

/* Active State for Private Filter */
.filter-btn.private-filter.active {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.25), rgba(31, 41, 55, 0.4));
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.3);
}

.filter-btn.private-filter.active {
    background: rgba(217, 119, 6, 0.15);
    border-color: #d97706;
    color: #fbbf24;
}

.filter-btn.private-filter.active .filter-icon {
    border-color: #fbbf24;
}

.filter-btn.private-filter.active span {
    color: #fbbf24;
}

/* VUT Filter Button (Teacher Red) */
.filter-btn.vut-filter {
    border: 2px solid #ef4444 !important;
    border-left: 4px solid #f87171 !important;
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.2), rgba(31, 41, 55, 0.2)) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

.filter-btn.vut-filter:hover {
    transform: translateX(8px) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25) !important;
    border-color: #f87171 !important;
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.3), rgba(31, 41, 55, 0.3)) !important;
}

.filter-btn.vut-filter span {
    color: #f87171 !important;
}

.filter-btn.vut-filter .filter-icon {
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.filter-btn.vut-filter.active {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

.filter-btn.vut-filter.active .filter-icon {
    border-color: #f87171 !important;
}

/* VUT Feed Item (Dashboard) */
.feed-item.vut-feed-item {
    border-left: 3px solid #ef4444 !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.1), transparent) !important;
}

.feed-item.vut-feed-item .feed-icon {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

.feed-item.vut-feed-item .subject-badge {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 3rem auto;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1rem 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}


/* --- GRID & CARDS --- */
.file-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* Changed from center to handle long text/badges better */
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    height: 100%;
    text-align: left;
    min-width: 0;
}


.file-card:hover {
    transform: translateY(-4px);
    border-color: #60a5fa;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.4), rgba(30, 41, 59, 0.9));
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.file-card:hover .file-icon {
    transform: scale(1.1);
}

.file-card:hover .file-name {
    color: #93c5fd;
}

.file-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.2rem;
    /* Align with top of text */
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.subject-badge,
.tag-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.8rem;
    border-radius: 99px;
    /* Pill shape for all tags */
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.subject-badge {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--secondary-color);
    border-color: rgba(59, 130, 246, 0.2);
}

.tag-badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Private Card Styling */
/* Private Card Styling (Premium Gold) */
.private-card {
    border: 1px solid #d97706;
    /* Golden Border */
    background: linear-gradient(135deg, rgba(66, 32, 6, 0.4), rgba(31, 41, 55, 0.6));
    /* Subtle Gold/Dark gradient */
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.15);
    /* Soft Gold Glow */
    position: relative;
    overflow: hidden;
}

.private-card .subject-badge,
.private-card .tag-badge {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.2);
}

.private-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #fbbf24;
    /* Brighter Gold Border */
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.4);
    /* Stronger Gold Glow */
    background: linear-gradient(135deg, rgba(146, 64, 14, 0.5), rgba(31, 41, 55, 0.8));
}

.private-card .file-icon {
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
}

.empty-msg,
.error-msg {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
}


/* --- MODAL (Premium Redesign) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly lighter backdrop */
    backdrop-filter: blur(8px);
    /* Blur the background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    /* Deep blue-gray base */
    width: 95%;
    /* Wider on small screens */
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 24px;
    padding: 0;
    /* Removing padding to let header flush */
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    /* For header overlap */
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    flex-grow: 1;
    overflow: auto;
    background: #0f172a;
    /* Inner content dark */
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.preview-image {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.preview-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    background: white;
    border-radius: 12px;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
}

.modal-body {
    flex-grow: 1;
    overflow: auto;
    background: #111827;
    /* Inner dark background */
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.modal-body.post-mode {
    display: block;
    text-align: left;
    height: auto;
    align-items: flex-start;
    justify-content: flex-start;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
}

.preview-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    background: white;
    /* Iframes often need white bg for docs */
}

.btn-download {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 99px;
    /* ROUND PILL */
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background-color: var(--secondary-color);
}

/* Login styling */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.telegram-btn {
    background: #0088cc !important;
    border: none !important;
    border-radius: 99px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    background: #0099ee !important;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    background-color: #111827;
    color: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.nav-auth {
    justify-self: start;
    display: flex;
    align-items: center;
}

/* --- DASHBOARD & LAYOUT --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.show-more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.show-more-link:hover {
    text-decoration: underline;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.4s ease-out;
}

.small-hero {
    margin-bottom: 4rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding: 3rem 1rem 6rem 1rem;
    position: relative;
    overflow: hidden;
    min-height: auto;
}

.small-hero .hero-title-large {
    font-size: clamp(3rem, 5vw, 4rem);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.small-hero h1,
.small-hero p {
    position: relative;
    z-index: 1;
}


/* --- SOFTWARE SPECIFIC HERO --- */
.software-hero {
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
}

.software-hero .floating-item {
    font-size: 3rem;
    opacity: 0.2;
    filter: blur(1px);
    position: absolute;
    animation: floatAnim 8s ease-in-out infinite;
}

.software-hero .float-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.software-hero .float-2 {
    top: 20%;
    right: 15%;
    animation-delay: -2s;
}

.software-hero .float-3 {
    bottom: 15%;
    left: 20%;
    animation-delay: -4s;
}

.software-hero .float-4 {
    bottom: 30%;
    right: 10%;
    animation-delay: -1s;
}

/* Existing small-hero styles */
.small-hero .hero-title-large {
    font-size: clamp(3rem, 5vw, 4rem);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* --- BENTO DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.bento-col-main,
.bento-col-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bento-card {
    background: rgba(31, 41, 55, 0.6);
    /* More transparent for glass effect */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 20px;
    /* Rounder corners */
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bento-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.sub-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tiny-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Feed List (Main) */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.feed-item.private-feed-item {
    border-left: 3px solid #d97706;
    /* Gold left border indicator */
    background: linear-gradient(to right, rgba(217, 119, 6, 0.1), transparent);
}

.feed-item.private-feed-item .feed-icon {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

.feed-item.private-feed-item .subject-badge {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}

.feed-icon {
    font-size: 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

.feed-info {
    flex-grow: 1;
}

.feed-name {
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: block;
}

.feed-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Quick Subjects (Sidebar) */
.quick-subjects {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.3);
    /* Blue tint */
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.subject-row-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subject-row-icon {
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.subject-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.subject-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.subject-row:hover .subject-arrow {
    color: var(--primary-color);
    transform: translateX(3px);
}

.hover-btn {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.feed-item:hover .hover-btn,
.subject-row:hover .hover-btn {
    opacity: 1;
    transform: translateX(0);
}

/* Private Subject Row Styling */
/* Private Subject Row Styling (Premium Gold) */
/* Private Subject Row Styling (Premium Gold) */
/* Private Subject Row Styling (Premium Gold - Max Visibility) */
.subject-row.private-subject-row {
    border: 2px solid #fbbf24;
    /* Thicker, Brighter Gold Border */
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.4), rgba(40, 30, 10, 0.6));
    /* Stronger Gold/Dark Gradient */
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3), inset 0 0 15px rgba(251, 191, 36, 0.1);
    /* intense glow */
    position: relative;
    overflow: hidden;
}

.subject-row.private-subject-row .subject-name {
    color: #fbbf24;
    /* Gold Text */
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}

.subject-row.private-subject-row .subject-row-icon {
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.subject-row.private-subject-row:hover {
    border-color: #fbbf24;
    background: linear-gradient(90deg, rgba(146, 64, 14, 0.5), rgba(31, 41, 55, 0.8));
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.3);
    transform: translateX(5px) scale(1.01);
}

.subject-row.private-subject-row .subject-row-icon {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

.subject-row.private-subject-row .subject-arrow {
    color: #d97706;
}

.subject-row.private-subject-row:hover .subject-arrow {
    color: #fbbf24;
}

/* Mini Posts (Sidebar) */
.mini-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-post {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mini-post-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.mini-post-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Project Strip */
.projects-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.project-mini {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.project-mini:hover {
    transform: translateY(-3px);
}

.project-mini-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.project-mini-content {
    padding: 0.75rem;
}

.project-mini-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- HERO SEARCH --- */
.hero-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem auto;
    overflow: hidden;
    border-radius: 99px;
}

.hero-search-wrapper:hover .card-glow {
    opacity: 1;
    transform: scale(1.1);
}

.hero-search-input {
    width: 100%;
    padding: 1rem 1.75rem;
    padding-right: 4rem;
    font-size: 1.1rem;
    background: rgba(15, 23, 42, 0.4);
    /* Deeper glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    color: white;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

.search-results-dropdown.active {
    display: block;
}

.hero-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.hero-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: transform 0.2s;
}

.hero-search-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* --- HERO ANIMATED BG --- */
.hero-bg-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulseBlob 8s infinite alternate;
    pointer-events: none;
}

@keyframes pulseBlob {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

/* --- NEW DASHBOARD LAYOUT (POSTS > PROJECTS > MATERIALS) --- */

.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.section-header.centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    border-bottom: none;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.section-header.centered h2 {
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    width: 100%;
    padding: 2rem;
}

/* --- COMPONENTS: CARDS --- */
.glass-card,
.file-card,
.post-card,
.project-card,
.bento-card,
.subject-row,
.feed-item {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    /* Added from old rule */
}

.glass-card:hover,
.file-card:hover,
.post-card:hover,
.project-card:hover,
.bento-card:hover,
.subject-row:hover,
.feed-item:hover {
    background: var(--card-bg-hover);
    border-color: var(--secondary-color);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.glass-card:hover .card-glow,
.post-card:hover .card-glow,
.project-card:hover .card-glow,
.feed-item:hover .card-glow,
.subject-row:hover .card-glow {
    opacity: 1;
    transform: scale(1.1);
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* For image */
}

.post-card-img {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
    overflow: hidden;
    /* Prevent spillover */
}

/* Ensure text doesn't overflow */
.post-card-content p {
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    max-width: 100%;
    /* Ensure it respects container width */
}

/* Ensure text doesn't overflow */
.post-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    max-width: 100%;
    /* Ensure it respects container width */
    word-break: break-word;
    /* Prevent long words from overflowing */
}

.read-more-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    align-self: flex-start;
    border-radius: 99px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.post-card-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    /* Optional circle look */
    background: rgba(255, 255, 255, 0.1);
    /* Subtle backing if transparent */
    padding: 2px;
}

.post-card-content h3 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.read-more {
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* PROJECTS STRIP */
.dashboard-projects-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: rgba(31, 41, 55, 0.6);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
}

.project-card:hover {
    transform: scale(1.02);
    border-color: rgba(59, 130, 246, 0.4);
}

.project-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.project-card-content {
    padding: 1rem;
    text-align: center;
}

.project-card-content h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* CENTERED FEED */
.feed-list.centered-feed {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* --- POSTS GRID REDESIGN --- */
#posts-grid,
.dashboard-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow);
}

.post-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.post-card-img {
    width: 100%;
    height: 200px;
    background-color: #374151;
    background-size: cover;
    background-position: center;
    position: relative;
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-header {
    margin-bottom: 0.5rem;
}

.post-card h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    color: white;
}

.read-more {
    margin-top: auto;
    padding-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.2s;
}

.post-card:hover .read-more {
    gap: 0.8rem;
}

/* --- MARKDOWN CONTENT --- */
.markdown-content {
    text-align: left;
    color: var(--text-color);
    line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
}

.markdown-content h1 {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 1.4rem;
    color: var(--secondary-color);
}

.markdown-content h3 {
    font-size: 1.2rem;
}

.markdown-content p {
    margin-bottom: 1.5rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content strong {
    color: white;
}

.markdown-content img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.markdown-content a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.markdown-content a:hover {
    color: #a5b4fc;
    border-bottom: 2px solid var(--secondary-color);
}

/* Special styling for email links */
.markdown-content a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    color: #e0e7ff;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin: 0.5rem 0;
    text-decoration: none;
}

.markdown-content a[href^="mailto:"]:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    /* Override standard hover */
}

.markdown-content a[href^="mailto:"]::before {
    content: "✉️";
    font-size: 1.1rem;
}

/* Allow buttons in markdown */
.markdown-content .btn-primary {
    display: inline-block;
    color: white !important;
    text-decoration: none;
    border-bottom: none;
    margin: 1rem 0;
}

/* --- CONTACTS PAGE --- */
.contacts-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Contact Info Grid */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
}

.contact-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.contact-icon {
    font-size: 1.75rem;
}

.contact-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.contact-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.contact-link,
.contact-text {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
}

/* Contact Form */
.contact-form-section {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
}

.contact-form-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 99px;
    /* Pill shape for inputs */
    border: 1px solid var(--border-color);
    background-color: #111827;
    color: white;
    font-family: inherit;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

.contact-form textarea {
    border-radius: 24px;
    /* Textarea needs less radius */
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.contact-form button {
    border-radius: 99px !important;
    /* Force round pill */
}

/* Socials */
.socials-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(88, 101, 242, 0.15);
    /* Discord Color Hint */
    border: 1px solid rgba(88, 101, 242, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 99px;
    /* Pill shape for social cards */
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.social-card:hover {
    background: rgba(88, 101, 242, 0.25);
    transform: translateX(5px);
}

.social-icon {
    font-size: 2rem;
}

.social-info {
    display: flex;
    flex-direction: column;
}

.social-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.social-handle {
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* --- DISCORD STATUS INTEGRATION --- */
.discord-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.discord-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.discord-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.discord-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid rgba(30, 41, 59, 1);
    /* Match card bg */
}

.discord-status-dot.online {
    background-color: #3ba55c;
}

.discord-status-dot.idle {
    background-color: #faa61a;
}

.discord-status-dot.dnd {
    background-color: #ed4245;
}

.discord-status-dot.offline {
    background-color: #747f8d;
}

.discord-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.discord-username {
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.discord-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.discord-status-text i {
    font-size: 0.6rem;
}

@media (max-width: 1024px) {
    .materials-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .materials-sidebar {
        position: relative;
        top: 0;
    }

    .filters-container {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
        padding-top: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        width: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* --- QUIZ SYSTEM REDESIGN --- */

/* Grid for Quiz Selection */
.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding-bottom: 4rem;
}

/* Quiz Selection Card - Redesigned */
.quiz-select-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 24px;
    padding: 0;
    /* Remove padding here, control internally */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 280px;
    /* Taller */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Glow Effect Blob */
.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.quiz-select-card:hover .card-glow {
    opacity: 1;
    transform: scale(1.1);
}

.quiz-select-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Header Section (Icon) */
.quiz-select-header {
    width: 100%;
    padding: 2.5rem 1rem 1rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.quiz-select-icon {
    font-size: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s;
}

.quiz-select-card:hover .quiz-icon-img {
    filter: drop-shadow(0 12px 20px rgba(59, 130, 246, 0.5));
}

.quiz-select-card:hover .quiz-select-icon {
    transform: scale(1.15) rotate(5deg);
}

/* Body Section */
.quiz-select-body {
    padding: 0 1.5rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-grow: 1;
    z-index: 1;
}

.quiz-select-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Score Badge */
.quiz-last-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    margin-bottom: auto;
    /* Push button down */
    width: 100%;
}

.quiz-last-score span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cbd5e1;
    margin-bottom: 0.2rem;
}

.quiz-last-score b {
    color: #34d399;
    font-size: 1.2rem;
}

.quiz-last-score-placeholder {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: auto;
    padding: 0.5rem;
}

/* Start Button (Visible on Hover) */
.quiz-start-btn {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    width: 100%;
}

.quiz-select-card:hover .quiz-start-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Role Specific Overrides */
.role-teacher .card-glow {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 60%);
}

.role-teacher:hover {
    border-color: rgba(239, 68, 68, 0.4);
}

.role-teacher .quiz-start-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.role-student .card-glow {
    background: radial-gradient(circle, rgba(250, 204, 21, 0.2) 0%, transparent 60%);
}

.role-student:hover {
    border-color: rgba(250, 204, 21, 0.4);
}

.role-student .quiz-start-btn {
    background: linear-gradient(135deg, #facc15, #ca8a04);
    color: #451a03;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4);
}


/* --- QUIZ PLAY SCREEN --- */
.quiz-play-container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3.5rem;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top Progress Line */
.quiz-play-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.quiz-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.subject-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* Progress Bar */
.quiz-progress-bar-container {
    margin-bottom: 3.5rem;
    position: relative;
}

.quiz-progress-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    /* Blue gradient */
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 99px;
    position: relative;
}

.quiz-progress-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.quiz-progress-glow::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: rgba(255, 255, 255, 0.8);
    filter: blur(8px);
    opacity: 0.6;
}

/* Question Typography */
.quiz-question-card {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

.quiz-question-text {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Options Grid */
.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .quiz-options-grid {
        grid-template-columns: 1fr;
    }

    .quiz-play-container {
        padding: 1.5rem;
    }

    .quiz-question-text {
        font-size: 1.5rem;
    }
}

/* Option Buttons */
.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Fainter border */
    padding: 1.5rem 2rem;
    border-radius: 20px;
    color: var(--text-color);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 80px;
    /* Ensure consistent height */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.option-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Option Circle Indicator */
.option-btn::before {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-right: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: bold;
}

.option-btn:hover::before {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

/* Correct Answer Style */
.option-btn.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid #10b981 !important;
    color: white !important;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.25) !important;
    transform: scale(1.02);
}

.option-btn.correct::before {
    content: '✓';
    background: #10b981;
    border-color: #10b981;
    color: white;
    box-shadow: 0 0 10px #10b981;
}

/* Wrong Answer Style */
.option-btn.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid #ef4444 !important;
    color: white !important;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.option-btn.wrong::before {
    content: '✕';
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.6;
    /* Slight fade for unselected disabled options */
}

.option-btn:disabled.correct,
.option-btn:disabled.wrong {
    opacity: 1;
    /* Keep correct/wrong distinct */
}

/* --- RESULT SCREEN --- */
.result-celebration {
    text-align: center;
    animation: popIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-icon-large {
    font-size: 6rem;
    margin-bottom: 2rem;
    display: inline-block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: floatAnim 4s ease-in-out infinite;
}

.score-circle {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 70%);
    padding: 1rem 4rem;
    border-radius: 99px;
    margin: 1rem 0 3rem 0;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.1);
}

#final-score {
    font-size: 5rem;
    font-weight: 900;
    color: #10b981;
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    line-height: 1;
}

.score-divider {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.2);
    margin: 0 1rem;
    font-weight: 300;
    transform: translateY(-10px);
}

.score-total {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.result-message-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3.5rem;
    letter-spacing: -0.5px;
}

.result-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Review Section */
#quiz-review-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 4rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.review-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
}

.review-item.correct-review {
    border-left-color: #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

.review-item.wrong-review {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.review-question {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.review-answer-row {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.review-answer-row.correct {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}

.review-answer-row.user-wrong {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    text-decoration: line-through;
    opacity: 0.8;
}


/* Animations */
@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatAnim {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}