/* Retro Terminal Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Code Pro', 'Input Sans', 'Courier New', monospace;
    background-color: #000000;
    color: #00ff00;
    line-height: 1.6;
    position: relative;
}

/* Isometric Background Canvas */
#background-canvas {
    position: fixed;
    top: 0;
    right: 20px;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.7;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #001100;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* Cursor Blink Animation */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Glisten Animation for title */
@keyframes glisten {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.5), 0 0 10px rgba(0, 255, 0, 0.3);
        color: #00ff00;
    }
    50% {
        text-shadow: 0 0 15px rgba(0, 255, 0, 0.8), 0 0 25px rgba(0, 255, 0, 0.5), 0 0 35px rgba(0, 255, 0, 0.3);
        color: #00ff88;
    }
}

.cursor-blink {
    animation: blink 1s infinite;
}

/* Terminal Output Styling */
.terminal-line {
    padding: 2px 0;
    word-wrap: break-word;
}

.terminal-line.title {
    padding: 0;
    line-height: 1;
    white-space: pre;
    font-variant-ligatures: none;
    animation: glisten 3s ease-in-out infinite;
}

.terminal-line.system {
    color: #00ff00;
}

.terminal-line.user {
    color: #00cc00;
}

.terminal-line.error {
    color: #ff0000;
}

.terminal-line.info {
    color: #00dd00;
}

/* Links in terminal */
.terminal-link {
    color: #00ff00;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.terminal-link:hover {
    color: #00ff88;
}

/* List items */
.terminal-list-item {
    padding-left: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.terminal-list-item:hover {
    color: #00ff88;
    text-decoration: underline;
}

/* Image display */
.terminal-image {
    max-width: 600px;
    max-height: 400px;
    border: 2px solid #00ff00;
    margin: 10px 0;
    image-rendering: auto;
}

/* Scanline effect - Enhanced */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 1001;
    opacity: 0.4;
}

/* Vignette effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.5) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
    z-index: 1000;
}

/* Ensure content is above background */
.h-screen {
    position: relative;
    z-index: 1;
}

/* CRT glow effect */
#terminal-output {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    height: calc(100vh - 60px); /* Leave space for input */
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
    padding-left:30px;
}

#terminal-content {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Input area container - above vignette */
.fixed.bottom-0 {
    z-index: 1002;
}

/* Input field */
#terminal-input {
    caret-color: transparent;
}

#terminal-input:focus {
    outline: none;
}

/* Input Area Focus/Hover */
.fixed:has(#terminal-input:focus),
.fixed:hover {
    border-top-color: #00ff00;
    box-shadow: 0 -4px 12px rgba(0, 255, 0, 0.3);
    transition: all 0.2s;
}

/* Smooth scroll */
#terminal-output {
    scroll-behavior: smooth;
}

/* Photo Panel */
.photo-panel {
    position: fixed;
    top: 0;
    right: -50%;
    width: 50%;
    height: 100%;
    background-color: #000000;
    border-left: 2px solid #00ff00;
    transition: right 0.3s ease-in-out;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.photo-panel.active {
    right: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .photo-panel {
        right: -100%;
        width: 100%;
        border-left: none;
        border-top: 2px solid #00ff00;
    }
    
    .photo-panel.active {
        right: 0;
    }
    
    body.panel-open #terminal-output,
    body.panel-open .fixed {
        width: 100%;
    }
    
    .photo-panel-content {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Adjust terminal when panel is open */
body.panel-open #terminal-output {
    width: 50%;
    transition: width 0.3s ease-in-out;
}

body.panel-open .fixed {
    width: 50%;
    transition: width 0.3s ease-in-out;
}

.photo-panel-header {
    padding: 20px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-panel-filters {
    padding: 20px;
    border-bottom: 1px solid #00ff00;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-panel-filters.active {
    display: flex;
}

#photo-panel-filters-year {
    background: rgba(0, 255, 0, 0.02);
}

#photo-panel-filters-subdir {
    background: rgba(0, 255, 0, 0.05);
    padding: 20px;
}

.filter-button {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 5px 15px;
    cursor: pointer;
    font-family: 'Source Code Pro', 'Input Sans', 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.2s;
}

.filter-button:hover {
    background: rgba(0, 255, 0, 0.1);
}

.filter-button.active {
    background: #00ff00;
    color: #000000;
}

.close-button {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Source Code Pro', 'Input Sans', 'Courier New', monospace;
    transition: all 0.2s;
}

.close-button:hover {
    background: #00ff00;
    color: #000000;
}

.photo-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    align-content: start;
}

.photo-panel-content::-webkit-scrollbar {
    width: 8px;
}

.photo-panel-content::-webkit-scrollbar-track {
    background: #001100;
}

.photo-panel-content::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.photo-panel-content::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

.photo-thumbnail {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid #00ff00;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}

.photo-thumbnail:hover {
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 5px;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Overlay when panel is open */
.photo-panel.active::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Photo viewer modal */
.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.photo-viewer.active {
    display: flex;
}

.photo-viewer img {
    max-width: 100%;
    max-height: 100%;
    border: 2px solid #00ff00;
    object-fit: contain;
}

.photo-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Source Code Pro', 'Input Sans', 'Courier New', monospace;
    font-size: 16px;
}

.photo-viewer-close:hover {
    background: #00ff00;
    color: #000000;
}

/* Item Detail Content */
.item-detail-content {
    padding: 0;
    color: #00ff00;
    line-height: 1.8;
}

.item-hero-image {
    width: 100%;
    border: 2px solid #00ff00;
    margin-bottom: 20px;
    display: block;
}

.item-heading {
    font-size: 24px;
    font-weight: 600;
    color: #00ff00;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.75rem;
}

.item-description {
    font-size: 14px;
    color: #00dd00;
    margin-bottom: 15px;
    line-height: 1.3rem;
    white-space: pre-wrap;
}

.item-block-text {
    font-size: 14px;
    color: #00dd00;
    margin: 20px 0;
    padding: 15px;
    border-left: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.03);
    line-height: 1.8;
    white-space: pre-wrap;
}

.item-block-image {
    width: 100%;
    border: 2px solid #00ff00;
    margin: 20px 0;
    display: block;
    cursor: pointer;
    transition: all 0.3s;
}

.item-block-image:hover {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.item-block-caption {
    font-size: 12px;
    color: #00cc00;
    margin-top: -15px;
    margin-bottom: 20px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 2px solid #00ff00;
}

/* Character Image - Bottom Right */
.character-image {
    position: fixed;
    bottom: -43px;
    left: 500px;
    width: 600px;
    height: auto;
    image-rendering: auto;
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}

/* Audio Toggle Button */
.audio-toggle {
    position: fixed;
    bottom: 15px;
    right: 20px;
    background: #00ff00;
    color: #000000;
    border: 2px solid #00ff00;
    padding: 5px 10px;
    font-family: 'Source Code Pro', 'Input Sans', 'Courier New', monospace;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    z-index: 2500;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.audio-toggle:hover {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: scale(1.05);
}

.audio-toggle.disabled {
    background: #003300;
    color: #00ff00;
    border-color: #00ff00;
}

.audio-toggle.disabled:hover {
    background: #004400;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

