:root {
    --bg-dark: #050505;
    --bg-panel: #0a0a0a;
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
.neon-text-cyan {
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.neon-text-magenta {
    font-family: var(--font-mono);
    color: var(--neon-magenta);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content {
    flex: 0 0 auto;
    align-self: flex-start;
    width: 100%;
}

.center-screen {
    justify-content: center;
    align-items: center;
}

/* Components */
.cyber-input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.cyber-input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.label-requirement {
    opacity: 0.8;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.cyber-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    padding: 0.75rem 0;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    outline: none;
    border-bottom-color: var(--neon-cyan);
    box-shadow: 0 10px 20px -10px rgba(0, 243, 255, 0.2);
}

.neon-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.75rem 2rem;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.neon-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.neon-btn.magenta {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
}

.neon-btn.magenta:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

/* Terminal Table */
.terminal-table-container {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #111;
    padding: 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--neon-cyan);
    border-bottom: 1px solid #222;
    font-size: 0.9rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #222;
    color: #ccc;
    font-size: 0.9rem;
}

tr:hover td {
    background: rgba(0, 243, 255, 0.05);
    color: #fff;
}

.btn-icon {
    background: none;
    border: 1px solid var(--neon-magenta);
    color: var(--neon-magenta);
    padding: 4px 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.btn-icon:hover {
    background: var(--neon-magenta);
    color: #000;
}

/* Utility */
.hidden {
    display: none !important;
}

.error-msg {
    color: var(--neon-magenta);
    margin-top: 1rem;
    font-family: var(--font-mono);
}

.success-msg {
    color: var(--neon-cyan);
    margin-top: 1rem;
    font-family: var(--font-mono);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Map Placeholder */
.map-placeholder {
    width: 100%;
    height: 600px;
    border: 1px solid #333;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.map-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

/* --- V2 Student Layout --- */
.student-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.cyber-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-toggle {
    display: none;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    object-fit: cover;
    background-image: url('../img/avatar.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.user-role {
    display: block;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.neon-btn.small {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Main Content Area */
.cyber-main {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.cyber-footer {
    background: #000;
    border-top: 1px solid #222;
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.footer-section h4 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-logos {
    display: flex;
    gap: 1.5rem;
}

.placeholder-logo {
    width: 60px;
    height: 60px;
    background: #111;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--neon-cyan);
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #111;
    color: #444;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}


/* --- Mobile Responsiveness --- */
@media (max-width: 1550px) {

    /* Layout */
    .container {
        padding: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Navbar - Mobile Layout: Cyberpunk Row */
    .cyber-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        border-bottom: 2px solid var(--neon-cyan);
        box-shadow: 0 5px 20px rgba(0, 243, 255, 0.1);
    }

    /* Burger Menu Icon (Cyber Angled Design) */
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 48px;
        height: 48px;
        padding: 8px;
        background: linear-gradient(135deg, rgba(0, 243, 255, 0.15) 0%, rgba(0, 243, 255, 0.05) 100%);
        border: 2px solid var(--neon-cyan);
        cursor: pointer;
        z-index: 102;
        margin: 0;
        order: 2;
        border-radius: 4px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    }

    .nav-toggle:active {
        background: linear-gradient(135deg, rgba(0, 243, 255, 0.25) 0%, rgba(0, 243, 255, 0.1) 100%);
        box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.2), 0 0 20px rgba(0, 243, 255, 0.4);
        transform: scale(0.98);
    }

    .nav-toggle:hover {
        background: linear-gradient(135deg, rgba(0, 243, 255, 0.2) 0%, rgba(0, 243, 255, 0.08) 100%);
        box-shadow: 0 0 25px rgba(0, 243, 255, 0.5);
        transform: scale(1.03);
    }

    .nav-toggle:hover .hamburger-lines span {
        box-shadow: 0 0 8px var(--neon-cyan);
    }

    /* Wrapper for lines */
    .hamburger-lines {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 22px;
        height: 15px;
    }

    .hamburger-lines span {
        display: block;
        height: 2.5px;
        width: 100%;
        background-color: var(--neon-cyan);
        border-radius: 1.25px;
        box-shadow: 0 0 6px var(--neon-cyan);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hide links by default on mobile */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(5, 5, 8, 0.99) 100%);
        padding: 0;
        border-top: 2px solid var(--neon-cyan);
        border-bottom: 2px solid var(--neon-magenta);
        backdrop-filter: blur(10px);

        /* Position as a block below the header row */
        position: static;
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        order: 3;
        margin-top: 0;

        /* Animation Base */
        opacity: 0;
        animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
            max-height: 0;
        }

        to {
            opacity: 1;
            transform: translateY(0);
            max-height: calc(100vh - 120px);
        }
    }

    /* Show links when active */
    .nav-links.show {
        display: flex;
    }

    /* Ensure all items are centered and standard */
    .nav-item {
        display: block !important;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0, 243, 255, 0.15);
        font-size: 0.85rem;
        letter-spacing: 1px;
        position: relative;
        overflow: hidden;
        text-align: center !important;
        width: 100% !important;
        justify-content: center !important;
        color: var(--text-secondary);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: uppercase;
    }

    /* Remove previous highlights - FORCE CENTER FOR LOGIN */
    .nav-item.login-btn,
    .nav-item.auth-guest {
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid rgba(0, 243, 255, 0.15) !important;
        color: var(--text-secondary) !important;
        font-weight: normal !important;
        padding: 0.75rem 1rem !important;
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        text-indent: 0 !important;
        text-decoration: none !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    /* Force text content to be centered */
    .nav-item.login-btn > *,
    .nav-item.auth-guest > * {
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Additional mobile-specific fix for login button */
    @media (max-width: 1550px) {
        .nav-item.login-btn {
            text-align: center !important;
            padding: 1rem 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin: 0 auto !important;
            margin-left: auto !important;
            margin-right: auto !important;
            display: block !important;
            width: 100% !important;
        }
        
        /* Ensure the link text itself is centered */
        .nav-item.login-btn,
        .nav-item.login-btn:link,
        .nav-item.login-btn:visited,
        .nav-item.login-btn:hover,
        .nav-item.login-btn:active {
            text-align: center !important;
        }
    }

    /* Enhanced hover effect for all */
    .nav-item:hover {
        background: linear-gradient(90deg, rgba(0, 243, 255, 0.1) 0%, rgba(0, 243, 255, 0.05) 100%);
        color: var(--neon-cyan);
        text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
        padding-left: 0;
        border-bottom-color: var(--neon-cyan);
        border-bottom-width: 2px;
    }

    .nav-item:active {
        background: rgba(0, 243, 255, 0.15);
        color: #fff;
    }

    .menu-text {
        display: none;
    }

    .nav-user {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #333;
    }

    /* Tables */
    .terminal-table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    /* Footer - handled by separate media queries below to support 4 columns */

    .footer-logos {
        justify-content: center;
        flex-direction: column;
        /* Stack vertically */
        align-items: center;
        gap: 1.5rem;
    }

    /* Smaller Logos for Mobile */
    .footer-logos img {
        height: 35px !important;
        /* Force smaller size */
    }
}

/* Desktop: Hide Burger */
.nav-toggle {
    display: none;
}

/* --- ADDED FIXES --- */

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* News Grid - Mobile */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-logos {
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.5rem;
    }

    /* General Logo Size (Partners/Patrons) */
    .footer-logos img {
        height: auto !important;
        max-height: 45px !important;
        width: auto !important;
        max-width: 120px !important;
        object-fit: contain;
    }

    /* Target ORGANIZATORZY (1st Section) - Make Bigger/Prominent */
    .footer-section:nth-child(1) .footer-logos img {
        max-height: 70px !important;
        max-width: 200px !important;
    }

    /* Ensure no horizontal overflow */
    body,
    html {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        width: 100%;
        padding: 1rem;
    }
}

/* Footer - Desktop and large tablets: 4 columns */
@media (min-width: 1201px) {
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr 1fr !important;
        gap: 2rem !important;
    }
}

/* Footer - Medium tablets: 4 columns with smaller gap */
@media (min-width: 900px) and (max-width: 1200px) {
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr 1fr !important;
        gap: 1rem !important;
        padding: 2rem 1.5rem !important;
    }
}

/* Footer - Ensure 4 columns in medium-large screens (1200px-1600px) */
@media (min-width: 1200px) and (max-width: 1600px) {
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Footer - Small tablets: 2 columns */
@media (max-width: 899px) and (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
        padding: 2rem 1rem !important;
    }
}

/* Phones - Footer in single column (vertical) */
@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
        padding: 2rem 1rem !important;
    }

    .footer-logos {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
}


/* --- LOADING ANIMATION - CTF THEMED --- */
.cyber-loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
}

/* Terminal Window */
.hacking-terminal {
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
    overflow: hidden;
}

/* Terminal Header */
.terminal-header {
    background: rgba(0, 243, 255, 0.1);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--neon-cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
}

.terminal-dot.active {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: pulse-dot 1s infinite;
}

/* Terminal Body */
.terminal-body {
    padding: 1.5rem;
    min-height: 200px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Status Messages */
.status-line {
    color: #00ff00;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInLine 0.3s forwards;
}

.status-line::before {
    content: '> ';
    color: var(--neon-cyan);
}

.status-line.error {
    color: #ff0066;
}

.status-line.success {
    color: var(--neon-cyan);
}

/* Typing cursor */
.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--neon-cyan);
    margin-left: 4px;
    animation: blink-cursor 0.8s infinite;
}

/* Progress Bar */
.hack-progress-container {
    margin-top: 1.5rem;
    width: 100%;
}

.hack-progress-label {
    color: #888;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.hack-progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.hack-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--neon-cyan) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: progressScan 2s linear infinite;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.hack-progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
    z-index: 1;
}

/* Hex dump effect in background */
.hex-rain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.1;
    pointer-events: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--neon-cyan);
    line-height: 1.2;
    white-space: pre;
}

/* Animations */
@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes blink-cursor {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes progressScan {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .terminal-body {
        font-size: 0.75rem;
        padding: 1rem;
        min-height: 150px;
    }

    .status-line {
        margin-bottom: 0.4rem;
    }
}

/* --- PAGE LOADING OVERLAY --- */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 5, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.5s ease-out;
}

/* Green variation for utilities */
.neon-text-green {
    font-family: var(--font-mono);
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.neon-btn.green {
    border-color: #00ff00;
    color: #00ff00;
}

.neon-btn.green:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
}

/* Info box for notifications */
.info-box {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-left: 3px solid var(--neon-cyan);
    padding: 1rem;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.5;
}

.info-box i {
    color: var(--neon-cyan);
    margin-right: 0.5rem;
}

/* Organizer Tabs */
.org-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.org-tab-btn:hover {
    color: var(--neon-green);
    border-bottom-color: var(--neon-green);
}

.org-tab-btn.active {
    color: var(--neon-green);
    border-bottom-color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.org-tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- NEWS CARD REDESIGN --- */
.news-card {
    border: 1px solid #333;
    padding: 2rem;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    /* Limit width */
    width: 100%;
}

.news-card:hover {
    border-color: #555;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.news-header {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.news-date {
    color: var(--neon-magenta);
}

.news-separator {
    color: #666;
}

.news-type {
    color: var(--neon-cyan);
    text-transform: uppercase;
}

.news-title {
    color: #fff;
    font-size: 1.5rem;
    font-family: var(--font-main);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: none;
}

.news-poster-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-start;
}

.news-poster {
    max-width: 60%;
    /* Allow shrinking below 60% */
    width: auto;
    max-height: 400px;
    /* Enforce global max height */
    height: auto;
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.news-content-text {
    color: #ccc;
    line-height: 1.6;
    font-size: 1rem;
}

/* Constrain images inside the content text too */
.news-content-text img {
    max-width: 60%;
    width: auto;
    max-height: 400px;
    height: auto;
    margin: 1rem 0;
    border: 1px solid #333;
}

/* ===== COMPREHENSIVE MOBILE OPTIMIZATION ===== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 1.5rem;
    }

    /* Improve button touch targets */
    .neon-btn {
        padding: 0.9rem 1.5rem;
        min-height: 44px;
        /* Minimum touch target size */
        font-size: 0.95rem;
    }

    /* Password toggle button sizing */
    .password-toggle,
    .password-toggle-login {
        padding: 0.6rem;
        font-size: 1.2rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Form inputs for better touch */
    .cyber-input {
        padding: 1rem 0;
        font-size: 1.1rem;
    }

    /* Input labels */
    .cyber-input-label {
        font-size: 0.85rem;
    }

    /* Heading sizes */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    /* Footer adjustments */
    .footer-content {
        gap: 1.5rem;
    }

    .footer-logos img {
        max-height: 50px;
    }
}

/* Phones (480px - 767px) */
@media (max-width: 767px) {
    /* Global sizing */
    html {
        font-size: 14px;
    }

    body {
        font-size: 14px;
    }

    /* Padding reduction */
    .container {
        padding: 1rem;
    }

    .cyber-nav {
        padding: 0.75rem 1rem;
    }

    .cyber-main {
        padding: 1rem;
    }

    .cyber-footer {
        padding: 2rem 1rem;
    }

    /* Form optimization */
    .cyber-input-group {
        margin-bottom: 1.2rem;
    }

    .cyber-input-label {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .cyber-input {
        padding: 0.8rem 0;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .cyber-input:focus {
        font-size: 16px;
    }

    /* Password toggle buttons */
    .password-toggle,
    .password-toggle-login {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 1.1rem;
        right: 5px;
    }

    .password-toggle-login {
        right: 5px;
    }

    /* Buttons - touch friendly */
    .neon-btn {
        padding: 1rem 1.2rem;
        min-height: 48px;
        font-size: 0.9rem;
        letter-spacing: 1.5px;
        width: 100%;
        display: block;
    }

    .neon-btn.small {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    /* Navbar adjustments */
    .nav-brand {
        font-size: 1.2rem;
        order: 1;
    }

    .nav-toggle {
        width: 44px;
        height: 44px;
        padding: 8px;
    }

    .nav-links {
        margin-top: 0.75rem;
    }

    .nav-item {
        padding: 1rem 0;
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .nav-item:active,
    .nav-item:focus {
        outline: 2px solid var(--neon-cyan);
        outline-offset: -2px;
    }

    /* Tables */
    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }

    /* News cards */
    .news-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .news-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .news-poster {
        max-width: 100%;
    }

    /* Grid layout */
    .grid-2-custom {
        grid-template-columns: 1fr !important;
    }

    .grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    .news-content-text img {
        max-width: 100%;
        max-height: 300px;
    }

    /* Footer logos */
    .footer-logos {
        flex-direction: column !important;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 1.5rem !important;
        align-items: center;
    }

    .footer-logos img {
        max-height: 50px;
        max-width: 150px;
    }

    .footer-section:nth-child(1) .footer-logos img {
        max-height: 60px;
        max-width: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Terminal loader */
    .cyber-loader-container {
        width: 95%;
        padding: 1.5rem;
    }

    .terminal-body {
        font-size: 0.7rem;
        padding: 1rem;
        min-height: 120px;
    }

    .terminal-title {
        font-size: 0.75rem;
    }

    /* Section spacing */
    .form-section {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Security alert box */
    .security-alert-box {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* User avatar on navbar */
    .nav-avatar {
        width: 32px;
        height: 32px;
        background-image: url('../img/avatar.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-role {
        font-size: 0.65rem;
    }
}

/* Small phones (< 480px) */
@media (max-width: 479px) {
    /* Base font sizing */
    html {
        font-size: 13px;
    }

    /* Critical spacing reductions */
    .container,
    .cyber-main {
        padding: 0.75rem;
    }

    .cyber-nav {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .cyber-footer {
        padding: 1.5rem 0.75rem;
    }

    /* Forms */
    .cyber-input {
        padding: 0.7rem 0;
        font-size: 16px;
    }

    .cyber-input-label {
        font-size: 0.7rem;
    }

    /* Buttons must stay accessible */
    .neon-btn {
        padding: 0.9rem 1rem;
        min-height: 44px;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }

    /* Navigation */
    .nav-brand {
        font-size: 1rem;
    }

    .nav-toggle {
        width: 40px;
        height: 40px;
    }

    .hamburger-lines {
        width: 20px;
        height: 14px;
    }

    .hamburger-lines span {
        height: 1.5px;
    }

    /* Text sizing */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .news-title {
        font-size: 1.1rem;
    }

    .terminal-title {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    /* Footer content */
    .footer-logos {
        gap: 0.75rem;
    }

    .footer-logos img {
        max-height: 35px;
        max-width: 90px;
    }

    /* Remove excess spacing */
    .news-card {
        padding: 1rem 0.75rem;
    }

    .form-section {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    /* Table text */
    table {
        font-size: 0.8rem;
    }

    th,
    td {
        padding: 0.5rem 0.3rem;
    }

    /* Prevent horizontal scrolling */
    body,
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Ensure full width */
    .cyber-main,
    .container {
        max-width: 100%;
        width: 100%;
    }
}

/* Extra small phones - landscape mode (max-height: 500px) */
@media (max-height: 500px) {
    .cyber-nav {
        padding: 0.5rem;
    }

    .nav-item {
        padding: 0.75rem 0;
    }

    .cyber-footer {
        padding: 1rem;
    }

    /* Reduce form spacing for better flow */
    .cyber-input-group {
        margin-bottom: 1rem;
    }

    /* Compact loader */
    .cyber-loader-container {
        padding: 1rem;
    }

    .terminal-body {
        min-height: 100px;
        font-size: 0.65rem;
    }
}

/* Landscape phones optimization */
@media (max-width: 767px) and (orientation: landscape) {
    html {
        font-size: 12px;
    }

    .cyber-nav {
        padding: 0.5rem 1rem;
    }

    .nav-item {
        padding: 0.6rem 0;
        font-size: 0.85rem;
    }

    .container,
    .cyber-main {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .neon-btn {
        padding: 0.75rem 1rem;
        min-height: 40px;
        font-size: 0.8rem;
    }

    /* Compact form */
    .cyber-input-group {
        margin-bottom: 0.8rem;
    }

    .cyber-input {
        padding: 0.6rem 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase click/tap targets */
    .neon-btn {
        min-height: 48px;
        min-width: 48px;
    }

    button {
        min-height: 48px;
        min-width: 48px;
    }

    .nav-item {
        padding: 1rem;
    }

    .password-toggle,
    .password-toggle-login {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects that don't work on touch */
    .neon-btn:hover {
        background: rgba(0, 243, 255, 0.05);
        box-shadow: none;
    }

    .neon-btn:active {
        background: rgba(0, 243, 255, 0.15);
        box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    }

    /* Smooth scrolling for touch */
    html {
        scroll-behavior: smooth;
    }

    /* Disable text selection on long tap */
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    input,
    textarea {
        -webkit-user-select: text;
    }
}

/* === ADDITIONAL RESPONSIVE FIXES === */

/* Logo responsive scaling */
.nav-brand img {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .nav-brand img {
        height: 32px !important;
    }
}

@media (max-width: 480px) {
    .nav-brand img {
        height: 28px !important;
    }
}

/* Ensure forms don't overflow on mobile */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
    max-width: 100%;
}

/* Prevent zoom on input focus on iOS */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea,
    .cyber-input {
        font-size: 16px !important;
    }
}

/* Improve readability on very small screens */
@media (max-width: 360px) {
    body {
        font-size: 12px;
    }

    .neon-btn {
        padding: 0.8rem 0.9rem;
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1rem;
    }

    h3 {
        font-size: 0.9rem;
    }

    .cyber-input {
        padding: 0.6rem 0;
    }
}

/* === TABLE RESPONSIVENESS === */
table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .terminal-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    thead {
        font-size: 0.8rem;
    }

    tbody {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.6rem 0.4rem;
    }
}

@media (max-width: 480px) {
    table {
        min-width: 100%;
        font-size: 0.7rem;
    }

    th, td {
        padding: 0.5rem 0.3rem;
    }

    /* Horizontal scroll indicator */
    .terminal-table-container {
        position: relative;
    }

    .terminal-table-container::after {
        content: '← scroll →';
        position: absolute;
        bottom: 5px;
        right: 10px;
        font-size: 0.65rem;
        color: rgba(0, 243, 255, 0.5);
        font-family: var(--font-mono);
        pointer-events: none;
    }
}

/* === ACCESSIBILITY & TOUCH IMPROVEMENTS === */

/* Focus states for keyboard navigation */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* Skip to main content link (for accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--neon-cyan);
    color: #000;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode detection */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-dark);
        color: var(--text-primary);
    }
}

/* High contrast support */
@media (prefers-contrast: more) {
    .cyber-input {
        border-bottom: 2px solid #333;
    }

    .neon-btn {
        border: 2px solid var(--neon-cyan);
    }
}

/* Large text support */
@media (min-width: 1921px) {
    html {
        font-size: 18px;
    }

    .container {
        max-width: 1800px;
    }
}

/* === AUTH VISIBILITY === */
/* Hide Dashboard by default (for non-logged-in users) */
.nav-item.auth-user {
    display: none !important;
}

/* Show Login/Register by default (for non-logged-in users) */
.nav-item.auth-guest {
    display: block !important;
}

/* === FIX FOR MOBILE VIEWPORT HEIGHT === */
/* Address iOS Safari viewport height issue */
@supports (bottom: max(0px)) {
    body {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .cyber-footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom) + 2rem);
    }
}

/* Safe area for notch devices */
@media (max-width: 767px) {
    .cyber-nav {
        padding-top: max(0.75rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .container,
    .cyber-main {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .cyber-footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Touch-friendly spacing adjustments */
@media (hover: none) {
    a, button, [role="button"] {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Print styles */
@media print {
    .cyber-nav,
    .cyber-footer,
    .nav-toggle,
    button {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }
}