/* Futuristic Neon Dashboard */
body {
    margin: 0;
    font-family: 'Orbitron', 'Rajdhani', 'Segoe UI', Arial, sans-serif;
    background: #111622;
    min-height: 100vh;
    height: 100vh;
    color: #fff;
    overflow-x: hidden;
    overflow-y: auto;
}

#bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0;
    background: url('mycitybackground2.png') center/cover, #101929;
    opacity: 0.30;
    /* Optional: animated stars or grid overlay */
}

/* Dynamic Particle System */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
}

.center-logo {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    pointer-events: none;
    width: 100%;
    max-width: 800px;
}

.logo-icon {
    margin-bottom: 12px;
    width: 64px; height: 64px;
    background: url('https://cdn-icons-png.flaticon.com/512/1621/1621668.png') center/contain no-repeat;
    filter: drop-shadow(0 0 18px #0ffefb);
    opacity: 0.95;
    margin: auto;
}

.neon-title {
    font-size: 2.6em;
    letter-spacing: 2px;
    color: #0ffefb;
    text-shadow: 0 0 16px #1aebff, 0 0 32px #00ffd0;
    font-weight: bold;
    animation: breathingGlow 3s ease-in-out infinite;
}

/* Breathing animation for the center logo */
@keyframes breathingGlow {
    0%, 100% {
        text-shadow: 0 0 16px #1aebff, 0 0 32px #00ffd0, 0 0 48px #0ffefb;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 24px #1aebff, 0 0 48px #00ffd0, 0 0 64px #0ffefb, 0 0 80px #42c5ff;
        transform: scale(1.02);
    }
}

 .radial-menu, #topicGrid {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 1;
    display: block;
    overflow: hidden;
}

/* Grid layout for topic cards: replaces circular layout to avoid overlap */
#topicGrid.grid-menu {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: auto;
    max-height: none;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 40px 24px 80px 24px;
}

/* Override absolute positioning/styles when using grid */
#topicGrid.grid-menu .topic-card {
    position: relative;
    width: 100%;
    max-width: none;
    min-height: 160px;
    max-height: none;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    opacity: 1 !important;
    animation: none !important;
}

/* Improve hover without 3D tilt in grid */
#topicGrid.grid-menu .topic-card:hover {
    transform: translateY(-3px) !important;
}

.menu-card, .topic-card {
    position: absolute;
    width: 280px;
    max-width: 85vw;
    min-height: 160px;
    max-height: 200px;
    background: rgba(17,28,44,.85);
    border: 2px solid #0aefff;
    border-radius: 18px;
    box-shadow: 0 0 26px #11e7ff55, 0 0 2px #0ffefb88;
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 18px 14px 14px 14px;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
    opacity: 0;
    transform: translate(-50%, -50%) rotateY(-15deg) scale(0.8);
    animation: cardEntranceStagger 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    overflow: hidden;
}

.menu-card h2 {
    margin: 0 0 8px 0;
    font-size: 1.16em;
    color: #16d7ff;
    text-shadow: 0 0 8px #16d7ff99;
}

.menu-card p {
    margin: 0;
    font-size: 0.95em;
    color: #e1fcff;
    opacity: 0.95;
}

.menu-card .card-icon {
    font-size: 2em;
    margin-bottom: 6px;
    display: inline-block;
    filter: drop-shadow(0 0 8px #0ffefb);
}

/* Card positions in circular layout - 26 sections around center (360° / 26 = 13.846° per card) */
/* Keep nth-child circular positions only for radial-menu context */
.radial-menu .menu-card:nth-child(1), .radial-menu .topic-card:nth-child(1) { top: 5%; left: 50%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(2), .radial-menu .topic-card:nth-child(2) { top: 6%; left: 60%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(3), .radial-menu .topic-card:nth-child(3) { top: 9%; left: 70%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(4), .radial-menu .topic-card:nth-child(4) { top: 13%; left: 78%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(5), .radial-menu .topic-card:nth-child(5) { top: 19%; left: 85%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(6), .radial-menu .topic-card:nth-child(6) { top: 25%; left: 91%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(7), .radial-menu .topic-card:nth-child(7) { top: 32%; left: 95%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(8), .radial-menu .topic-card:nth-child(8) { top: 40%; left: 97%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(9), .radial-menu .topic-card:nth-child(9) { top: 48%; left: 98%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(10), .radial-menu .topic-card:nth-child(10) { top: 56%; left: 98%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(11), .radial-menu .topic-card:nth-child(11) { top: 64%; left: 97%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(12), .radial-menu .topic-card:nth-child(12) { top: 71%; left: 95%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(13), .radial-menu .topic-card:nth-child(13) { top: 78%; left: 91%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(14), .radial-menu .topic-card:nth-child(14) { top: 84%; left: 85%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(15), .radial-menu .topic-card:nth-child(15) { top: 89%; left: 78%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(16), .radial-menu .topic-card:nth-child(16) { top: 93%; left: 70%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(17), .radial-menu .topic-card:nth-child(17) { top: 95%; left: 60%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(18), .radial-menu .topic-card:nth-child(18) { top: 96%; left: 50%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(19), .radial-menu .topic-card:nth-child(19) { top: 95%; left: 40%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(20), .radial-menu .topic-card:nth-child(20) { top: 93%; left: 30%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(21), .radial-menu .topic-card:nth-child(21) { top: 89%; left: 22%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(22), .radial-menu .topic-card:nth-child(22) { top: 84%; left: 15%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(23), .radial-menu .topic-card:nth-child(23) { top: 78%; left: 9%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(24), .radial-menu .topic-card:nth-child(24) { top: 71%; left: 5%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(25), .radial-menu .topic-card:nth-child(25) { top: 64%; left: 3%; transform: translate(-50%, -50%); }
.radial-menu .menu-card:nth-child(26), .radial-menu .topic-card:nth-child(26) { top: 56%; left: 2%; transform: translate(-50%, -50%); }

.menu-card:hover, .topic-card:hover {
    box-shadow: 0 0 50px #45fdfa, 0 0 16px #00ffd0, 0 10px 30px rgba(0, 255, 208, 0.3);
    border-color: #38faff;
    z-index: 2;
    transform: translate(-50%, -50%) rotateY(5deg) rotateX(-2deg) scale(1.05);
}

/* Staggered entrance animations */
@keyframes cardEntranceStagger {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotateY(-15deg) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) rotateY(0deg) scale(1);
    }
}

.menu-card:nth-child(1), .topic-card:nth-child(1) { animation-delay: 0.05s; }
.menu-card:nth-child(2), .topic-card:nth-child(2) { animation-delay: 0.10s; }
.menu-card:nth-child(3), .topic-card:nth-child(3) { animation-delay: 0.15s; }
.menu-card:nth-child(4), .topic-card:nth-child(4) { animation-delay: 0.20s; }
.menu-card:nth-child(5), .topic-card:nth-child(5) { animation-delay: 0.25s; }
.menu-card:nth-child(6), .topic-card:nth-child(6) { animation-delay: 0.30s; }
.menu-card:nth-child(7), .topic-card:nth-child(7) { animation-delay: 0.35s; }
.menu-card:nth-child(8), .topic-card:nth-child(8) { animation-delay: 0.40s; }
.menu-card:nth-child(9), .topic-card:nth-child(9) { animation-delay: 0.45s; }
.menu-card:nth-child(10), .topic-card:nth-child(10) { animation-delay: 0.50s; }
.menu-card:nth-child(11), .topic-card:nth-child(11) { animation-delay: 0.55s; }
.menu-card:nth-child(12), .topic-card:nth-child(12) { animation-delay: 0.60s; }
.menu-card:nth-child(13), .topic-card:nth-child(13) { animation-delay: 0.65s; }
.menu-card:nth-child(14), .topic-card:nth-child(14) { animation-delay: 0.70s; }
.menu-card:nth-child(15), .topic-card:nth-child(15) { animation-delay: 0.75s; }
.menu-card:nth-child(16), .topic-card:nth-child(16) { animation-delay: 0.80s; }
.menu-card:nth-child(17), .topic-card:nth-child(17) { animation-delay: 0.85s; }
.menu-card:nth-child(18), .topic-card:nth-child(18) { animation-delay: 0.90s; }
.menu-card:nth-child(19), .topic-card:nth-child(19) { animation-delay: 0.95s; }
.menu-card:nth-child(20), .topic-card:nth-child(20) { animation-delay: 1.00s; }
.menu-card:nth-child(21), .topic-card:nth-child(21) { animation-delay: 1.05s; }
.menu-card:nth-child(22), .topic-card:nth-child(22) { animation-delay: 1.10s; }
.menu-card:nth-child(23), .topic-card:nth-child(23) { animation-delay: 1.15s; }
.menu-card:nth-child(24), .topic-card:nth-child(24) { animation-delay: 1.20s; }
.menu-card:nth-child(25), .topic-card:nth-child(25) { animation-delay: 1.25s; }
.menu-card:nth-child(26), .topic-card:nth-child(26) { animation-delay: 1.30s; }

/* Holographic Effects */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        transparent 50%, 
        rgba(0, 255, 255, 0.03) 50%, 
        rgba(0, 255, 255, 0.05) 51%, 
        transparent 52%
    );
    background-size: 100% 4px;
    animation: scanLines 0.1s linear infinite;
}

@keyframes scanLines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    color: #0f3;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    opacity: 0.3;
    animation: matrixFall linear infinite;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 4;
    pointer-events: none;
}

.trail-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #0ffefb;
    border-radius: 50%;
    box-shadow: 0 0 10px #0ffefb;
    animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* Glitch effect for section transitions */
.glitch-effect {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: translate(-1px, -1px);
        filter: hue-rotate(180deg);
    }
    30% {
        transform: translate(1px, 2px);
        filter: hue-rotate(270deg);
    }
    40% {
        transform: translate(1px, -1px);
        filter: hue-rotate(360deg);
    }
    50% {
        transform: translate(-1px, 2px);
        filter: hue-rotate(90deg);
    }
    60% {
        transform: translate(-1px, 1px);
        filter: hue-rotate(180deg);
    }
    70% {
        transform: translate(1px, 1px);
        filter: hue-rotate(270deg);
    }
    80% {
        transform: translate(-1px, -1px);
        filter: hue-rotate(360deg);
    }
    90% {
        transform: translate(1px, 2px);
        filter: hue-rotate(90deg);
    }
}

/* Smart Command Line Interface */
#terminal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 45vh;
    max-height: 500px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 2px solid #0ffefb;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    color: #0ffefb;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(5px);
    box-shadow: 0 -5px 30px rgba(15, 254, 251, 0.3);
    display: flex;
    flex-direction: column;
}

.terminal-hidden {
    transform: translateY(100%);
}

.terminal-visible {
    transform: translateY(0);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(15, 254, 251, 0.1);
    border-bottom: 1px solid #0ffefb;
}

.terminal-title {
    font-size: 14px;
    font-weight: bold;
}

.terminal-close-btn {
    background: none;
    border: none;
    color: #ff4757;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.terminal-close-btn:hover {
    background-color: rgba(255, 71, 87, 0.2);
}

.terminal-body {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    line-height: 1.4;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 5px 0;
    min-height: 30px;
}

.terminal-prompt {
    color: #42c5ff;
    font-weight: bold;
    flex-shrink: 0;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #0ffefb;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    flex: 1;
    outline: none;
    caret-color: #0ffefb;
    padding: 4px 0;
    line-height: 1.5;
}

.terminal-output-line {
    margin: 2px 0;
}

.terminal-command {
    color: #42c5ff;
}

.terminal-response {
    color: #0ffefb;
    margin-left: 0;
}

.terminal-error {
    color: #ff6b6b;
}

.terminal-success {
    color: #51cf66;
}

.terminal-warning {
    color: #ffd43b;
}

.ascii-art {
    color: #ae9fff;
    line-height: 1.2;
    font-size: 12px;
}

/* Additional styles for app.js compatibility */
.topic-card {
    cursor: pointer;
}

.topic-card.unlocked {
    border-color: #51cf66;
    box-shadow: 0 0 26px #51cf6655, 0 0 2px #51cf66;
}

.topic-card.locked {
    border-color: #ff6b6b;
    box-shadow: 0 0 26px #ff6b6b55, 0 0 2px #ff6b6b;
}

.topic-icon {
    font-size: 2em;
    margin-bottom: 6px;
    display: inline-block;
    filter: drop-shadow(0 0 8px #0ffefb);
}

.topic-title {
    margin: 0 0 8px 0;
    font-size: 1.16em;
    color: #16d7ff;
    text-shadow: 0 0 8px #16d7ff99;
}

.topic-description {
    margin: 0;
    font-size: 0.95em;
    color: #e1fcff;
    opacity: 0.95;
}

.password-modal {
    position: fixed;
    top: 0; left:0; width: 100vw; height:100vh;
    background: rgba(16,30,48,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.password-modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(11,31,49,.92);
    border: 2px solid #19e5ff;
    border-radius: 16px;
    padding: 40px 30px;
    min-width: 350px;
    max-width: 90vw;
    box-shadow: 0 0 24px #11e7ff55;
    text-align: center;
    color: #fff;
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
    color: #0ffefb;
    text-shadow: 0 0 10px #0ffefb;
}

.modal-content p {
    color: #e1fcff;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0,0,0,0.5);
    border: 1px solid #0ffefb;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.modal-content input:focus {
    border-color: #42c5ff;
    box-shadow: 0 0 10px rgba(66, 197, 255, 0.5);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-outline {
    padding: 8px 20px;
    border: 1px solid #0ffefb;
    border-radius: 8px;
    background: transparent;
    color: #0ffefb;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: rgba(15, 254, 251, 0.1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ff4757;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-neon {
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg,#0ffefb 0%,#1447e6 100%);
    color: #171f35;
    font-weight: bold;
    box-shadow: 0 0 16px #0ffefb80;
    font-size: 1em;
    cursor: pointer;
    margin-top: 16px;
    text-shadow: 0 0 4px #fff;
    transition: background 0.2s;
}

.btn-neon:hover {
    background: linear-gradient(90deg,#1447e6 0%,#0ffefb 100%);
    color: #fff;
}

/* Responsive adjustments for rectangular border layout */
@media (max-width: 1200px) {
    .menu-card, .topic-card {
        width: 280px;
        min-height: 160px;
        padding: 18px 12px 12px 12px;
    }
    
    .menu-card h2 {
        font-size: 1.1em;
    }
    
    .menu-card p {
        font-size: 0.9em;
    }
}

@media (max-width: 900px) {
    .radial-menu {
        width: 100vw; height: 100vh;
        position: relative;
    }
    
    .center-logo {
        position: fixed;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
    }
    
    .menu-card, .topic-card {
        width: 240px;
        min-height: 140px;
        padding: 15px 10px 10px 10px;
    }
    
    .neon-title {
        font-size: 2.2em;
    }
}

@media (max-width: 600px) {
    .menu-card, .topic-card {
        width: 92vw; 
        padding: 20px; 
        font-size: 1em;
        min-height: 100px;
        position: static !important;
        transform: none !important;
        margin-bottom: 20px;
        left: auto !important;
        top: auto !important;
        opacity: 1 !important;
        animation: none !important;
    }
    
    .radial-menu {
        width: 100vw; 
        height: auto; 
        min-height: 600px;
        position: static;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
    }
    
    .center-logo {
        position: static;
        transform: none;
        margin-bottom: 30px;
        width: 100%;
        max-width: none;
    }
    
    .neon-title {
        font-size: 1.8em;
    }
}
