/* 
    Project: Snowball Hero Profile
    Theme: Dark Futuristic / Cyberpunk Cat
    Colors: Dark Grey/Black Background, Electric Blue Accents
*/

:root {
    --bg-dark: #050505;
    --bg-panel: #111111;
    --accent-blue: #00f3ff;
    --accent-dim: #005f63;
    --text-main: #e0e0e0;
    --text-dim: #888888;
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --border-glow: 0 0 10px rgba(0, 243, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none; /* Hide default cursor globally */
}

/* Ensure interactive elements don't show the system hand cursor */
a, button, [role="button"], .tab-btn, .music-btn, .profile-frame {
    cursor: none !important;
}

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

/* Interactive Background */
#cyber-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Custom Cyber Cursor */
#cyber-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1px solid var(--accent-blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10010; /* Highest priority, even above modals */
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: difference;
}

#cyber-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

#cyber-cursor.hovered {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 243, 255, 0.1);
    border-color: #fff;
}

/* Typewriter Effect Cursor */
.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-head);
    text-transform: uppercase;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

/* Header */
.cyber-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 2px solid var(--accent-blue);
    background: linear-gradient(to bottom, #000, #0a0a0a);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.2);
    position: relative;
}

.cyber-header h1 {
    font-size: 2.5rem;
    text-shadow: 0 0 15px var(--accent-blue);
    margin-bottom: 0.5rem;
}

.music-btn {
    background: transparent;
    border: 1px solid var(--accent-dim);
    color: var(--text-dim);
    font-family: var(--font-head);
    padding: 5px 15px;
    margin-top: 10px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.music-btn:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
}

.agent-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px auto 10px;
    max-width: 1200px;
    padding: 0 20px;
}

.tab-btn {
    background: var(--bg-panel);
    border: 1px solid var(--accent-dim);
    color: var(--text-dim);
    padding: 12px 25px;
    font-family: var(--font-head);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(15% 0, 100% 0, 100% 75%, 85% 100%, 0 100%, 0 25%);
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue);
    font-weight: bold;
}

.tagline {
    font-size: calc(1.2rem - 2pt);
    color: var(--text-dim);
    font-family: var(--font-head);
}

.blink {
    animation: cyber-blink 2s infinite;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

@keyframes cyber-blink {
    0%, 100% { opacity: 1; }
    3% { opacity: 0.4; }
    6% { opacity: 1; }
    7% { opacity: 0.4; }
    8% { opacity: 1; }
    9% { opacity: 1; }
    10% { opacity: 0.1; }
    11% { opacity: 1; }
    50% { opacity: 1; }
    52% { opacity: 0.4; }
    54% { opacity: 1; }
    70% { opacity: 1; }
    72% { opacity: 0.4; }
    74% { opacity: 1; }
}

/* Main Layout - Flexbox */
.content-wrapper {
    min-height: 600px;
}

.agent-profile {
    display: none;
}

.agent-profile.active {
    display: flex;
}

.main-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 30px;
}

.profile-img-placeholder {
    color: var(--accent-dim);
    font-family: var(--font-head);
    text-shadow: 0 0 5px var(--accent-dim);
}

/* Left Column (Sidebar) */
.profile-column {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Right Column (Content) */
.info-column {
    flex: 2 1 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Profile Picture Placeholder */
.profile-frame {
    border: 2px solid var(--accent-blue);
    padding: 5px;
    background: var(--bg-panel);
    position: relative;
    box-shadow: var(--border-glow);
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}

.profile-pic-placeholder {
    width: 100%;
    height: 350px;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dim);
    font-family: var(--font-head);
    position: relative;
    overflow: hidden;
    transform: translateZ(0); 
    border-radius: 0;
    background-image: repeating-linear-gradient(
        45deg,
        #050505,
        #050505 10px,
        #080808 10px,
        #080808 20px
    );
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.8) contrast(1.2);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.scanner-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    top: 0;
    left: 0;
    animation: scan 3s infinite linear;
    box-shadow: 0 0 10px var(--accent-blue);
    z-index: 3;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.caption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-family: var(--font-head);
}

/* Stats Panel */
.stats-panel {
    background: var(--bg-panel);
    padding: 20px;
    border: 1px solid var(--accent-dim);
    border-left: 4px solid var(--accent-blue);
}

.stat-list {
    list-style: none;
    margin-top: 15px;
}

.stat-list li {
    margin-bottom: 15px;
}

.label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-main);
}

.progress-bar {
    background: #222;
    height: 10px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid #333;
}

.fill {
    background: var(--accent-blue);
    height: 100%;
    box-shadow: 0 0 10px var(--accent-blue);
}

/* Data Cards */
.data-card {
    background: var(--bg-panel);
    padding: 25px;
    border: 1px solid var(--accent-dim);
    position: relative;
}

.data-card::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent-blue);
    border-right: 2px solid var(--accent-blue);
}

.data-card h2 {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--accent-dim);
    padding-bottom: 5px;
    display: flex;
    align-items: center;
}

.icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Abilities Grid */
.ability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.ability-item {
    background: rgba(0, 243, 255, 0.05);
    padding: 15px;
    border-left: 2px solid var(--accent-blue);
}

.ability-item h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 5px;
}

/* Log List */
.log-list {
    list-style: none;
    font-family: 'Courier New', monospace;
    color: var(--text-dim);
}

.log-list li {
    margin-bottom: 8px;
    border-bottom: 1px dashed #333;
    padding-bottom: 8px;
}

.time {
    color: var(--accent-blue);
    font-weight: bold;
}

/* Footer */
.cyber-footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    border-top: 1px solid var(--accent-dim);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.cyber-glitch-active {
    animation: image-swap-glitch 0.5s steps(3) forwards;
}

@keyframes image-swap-glitch {
    0% {
        filter: none;
        transform: translate(0, 0);
        opacity: 1;
    }
    10% {
        filter: invert(1) hue-rotate(90deg) contrast(2);
        transform: translate(-5px, 2px);
        opacity: 0.8;
    }
    30% {
        filter: sepia(1) hue-rotate(180deg) blur(2px);
        transform: translate(5px, -2px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        filter: invert(1) grayscale(1);
        transform: translate(-2px, 5px);
        opacity: 0;
    }
    70% {
        filter: hue-rotate(270deg) contrast(3);
        transform: translate(2px, -5px) scale(0.9);
        opacity: 0.5;
    }
    90% {
        filter: invert(1);
        transform: translate(0, 0);
        opacity: 0.8;
    }
    100% {
        filter: none;
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    /* Flatten the sidebar so we can reorder its children relative to the main content */
    .profile-column {
        display: contents;
    }

    /* Define the order of elements on mobile */
    .profile-frame {
        order: 1;
    }

    .stats-panel {
        order: 2;
    }

    .info-column {
        order: 3;
    }

    .cyber-header h1 {
        font-size: 1.8rem;
        padding: 0 10px;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

/* CRT Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    animation: crt-flicker 0.15s infinite;
    opacity: 0.3;
}

.crt-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 2px;
    z-index: 2;
}

@keyframes crt-flicker {
    0% { opacity: 0.3; }
    50% { opacity: 0.35; }
    100% { opacity: 0.3; }
}

/* Mobile Adjustments for Cursor */
@media (max-width: 768px) {
    #cyber-cursor {
        display: none;
    }
    *, body, a, button, [role="button"], .tab-btn, .music-btn, .profile-frame {
        cursor: auto !important; /* Restore default touch interaction */
    }
}

/* --- OPTION 2: TERMINAL INTERFACE --- */
#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10002; /* Ensure it is on top of everything for interaction */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#terminal-window {
    width: 800px;
    height: 500px;
    background: #0c0c0c;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    color: #0f0;
    overflow: hidden;
    position: relative;
}

.terminal-header {
    background: var(--accent-dim);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--accent-blue);
}

.terminal-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.terminal-line {
    margin-bottom: 5px;
    word-break: break-all;
}

.terminal-input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: var(--accent-blue);
    margin-right: 10px;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}

/* Custom Scrollbar for Terminal */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #000;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border: 1px solid var(--accent-blue);
}

/* Boot Sequence Overlay */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: var(--accent-blue);
    z-index: 10001; /* Above everything */
    padding: 40px;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Text flows from bottom */
}

/* --- OPTION 3: TACTICAL HUD --- */
/* Glitch Transition */
.glitch-transition {
    animation: global-glitch 0.4s steps(2) forwards;
}

@keyframes global-glitch {
    0% { transform: translate(0); filter: hue-rotate(0deg); }
    25% { transform: translate(-5px, 5px); filter: hue-rotate(90deg) contrast(2); }
    50% { transform: translate(10px, -5px); filter: invert(1); }
    75% { transform: translate(-10px, -2px); filter: sepia(1) blur(1px); }
    100% { transform: translate(0); filter: none; }
}

/* Mobile Adjustments for HUD */
@media (max-width: 768px) {
    .radar-panel {
        display: none; /* Hide radar on mobile to save space */
    }
}

/* --- GALLERY --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--accent-dim);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10005;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    max-width: 90%;
    max-height: 80%;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue);
    object-fit: contain;
}

.modal-caption {
    margin-top: 15px;
    color: var(--accent-blue);
    font-family: var(--font-head);
    font-size: 1.2rem;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--text-dim);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10006;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    transform: translateY(-50%);
}

.nav-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    font-size: 2rem;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--accent-blue);
    color: #000;
}

/* Ensure modal overrides cursor globally when active */
.modal.active {
    cursor: auto;
}
