/* ===== DETECTIVE THEME VARIABLES ===== */
:root {
    --paper-bg: #e8dcc4;
    --dark-bg: #1a1612;
    --ink-black: #0d0d0d;
    --sepia: #8b7355;
    --red-stamp: #c41e3a;
    --yellow-light: #f4e8c1;
    --green-confirm: #2d5016;
    --border-brown: #4a3f35;
}

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

body {
    font-family: 'Courier Prime', monospace;
    background-color: var(--dark-bg);
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        ),
        radial-gradient(circle at 20% 50%, rgba(139,115,85,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139,115,85,0.05) 0%, transparent 50%);
    color: var(--paper-bg);
    overflow-x: hidden;
}

/* ===== SCANLINES EFFECT ===== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.05) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0,0,0,0.05) 3px
    );
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* ===== HEADER ===== */
.header {
    position: relative;
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(180deg, rgba(26,22,18,0.95) 0%, rgba(26,22,18,0.7) 100%);
    border-bottom: 3px solid var(--sepia);
    box-shadow: inset 0 -20px 40px rgba(0,0,0,0.3);
}

.case-stamp {
    display: inline-block;
    font-family: 'Special Elite', cursive;
    color: var(--red-stamp);
    font-size: 0.9rem;
    letter-spacing: 4px;
    padding: 0.3rem 1.5rem;
    border: 3px solid var(--red-stamp);
    transform: rotate(-3deg);
    margin-bottom: 1.5rem;
    animation: stampAppear 0.5s ease-out;
}

@keyframes stampAppear {
    0% { transform: rotate(-3deg) scale(0); opacity: 0; }
    50% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(-3deg) scale(1); opacity: 1; }
}

.title {
    font-family: 'Special Elite', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--yellow-light);
    text-shadow: 
        2px 2px 0px var(--ink-black),
        4px 4px 10px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.typewriter {
    display: inline-block;
    border-right: 4px solid var(--yellow-light);
    animation: typing 2s steps(18) 1s both, blink 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--sepia);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.case-number {
    font-family: 'Courier Prime', monospace;
    color: var(--paper-bg);
    font-size: 0.9rem;
    opacity: 0.7;
    letter-spacing: 3px;
}

/* ===== EVIDENCE BOARD ===== */
.evidence-board {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.board-title {
    text-align: center;
    margin-bottom: 3rem;
}

.board-title h2 {
    font-family: 'Special Elite', cursive;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--red-stamp);
    text-decoration: underline;
    text-decoration-color: var(--sepia);
    text-underline-offset: 8px;
    margin-bottom: 0.5rem;
}

.board-title p {
    color: var(--sepia);
    font-size: 1rem;
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 1rem;
}

.evidence-photo {
    position: relative;
    animation: floatIn 0.6s ease-out backwards;
}

.evidence-photo:nth-child(1) { animation-delay: 0.1s; }
.evidence-photo:nth-child(2) { animation-delay: 0.2s; }
.evidence-photo:nth-child(3) { animation-delay: 0.3s; }
.evidence-photo:nth-child(4) { animation-delay: 0.4s; }
.evidence-photo:nth-child(5) { animation-delay: 0.5s; }
.evidence-photo:nth-child(6) { animation-delay: 0.6s; }
.evidence-photo:nth-child(7) { animation-delay: 0.7s; }
.evidence-photo:nth-child(8) { animation-delay: 0.8s; }
.evidence-photo:nth-child(9) { animation-delay: 0.9s; }

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.photo-frame {
    position: relative;
    background: var(--paper-bg);
    padding: 1rem;
    box-shadow: 
        0 2px 5px rgba(0,0,0,0.2),
        0 10px 30px rgba(0,0,0,0.4),
        inset 0 0 50px rgba(0,0,0,0.05);
    cursor: pointer;
    transform: rotate(0deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.photo-frame::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.photo-frame:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.3),
        0 15px 50px rgba(0,0,0,0.5);
}

.photo-frame img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    filter: sepia(0.1) contrast(1.1);
    transition: filter 0.3s ease;
}

.photo-frame:hover img {
    filter: sepia(0) contrast(1.2);
}

.photo-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-frame:hover .photo-overlay {
    opacity: 1;
}

.magnify-icon {
    font-size: 3rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.evidence-tag {
    position: absolute;
    bottom: -10px;
    right: 10px;
    background: var(--red-stamp);
    color: white;
    font-family: 'Special Elite', cursive;
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    letter-spacing: 1px;
    transform: rotate(2deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    background: var(--red-stamp);
    color: white;
    border: 3px solid var(--paper-bg);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: #d32f2f;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--paper-bg);
    padding: 2rem;
    box-shadow: 
        0 10px 50px rgba(0,0,0,0.7),
        inset 0 0 100px rgba(0,0,0,0.05);
}

.modal-left {
    position: relative;
}

.modal-left img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border: 8px solid white;
    box-shadow: 
        0 5px 20px rgba(0,0,0,0.3),
        inset 0 0 30px rgba(0,0,0,0.1);
}

/* ===== CASE FILE ===== */
.case-file {
    background: rgba(255,255,255,0.95);
    border: 2px solid var(--border-brown);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.file-header {
    background: var(--ink-black);
    color: var(--yellow-light);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--red-stamp);
}

.file-header h3 {
    font-family: 'Special Elite', cursive;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.classified-stamp {
    font-family: 'Special Elite', cursive;
    color: var(--red-stamp);
    font-size: 0.8rem;
    border: 2px solid var(--red-stamp);
    padding: 0.2rem 0.8rem;
    transform: rotate(-5deg);
}

.file-content {
    padding: 2rem 1.5rem;
    color: var(--ink-black);
}

.info-row {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--sepia);
}

.info-row .label {
    font-weight: bold;
    min-width: 120px;
    color: var(--border-brown);
}

.info-row .value {
    flex: 1;
    color: var(--ink-black);
}

.value.coordinates {
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
}

.value.status {
    color: var(--green-confirm);
    font-weight: bold;
}

.divider {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--sepia), transparent);
    margin: 1.5rem 0;
}

.description,
.best-time {
    margin-bottom: 1.5rem;
}

.description h4,
.best-time h4,
.difficulty h4 {
    font-family: 'Special Elite', cursive;
    color: var(--red-stamp);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.description p,
.best-time p {
    line-height: 1.6;
    text-align: justify;
}

.difficulty-bars {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.difficulty-bars .bar {
    flex: 1;
    height: 20px;
    background: #ddd;
    border: 2px solid var(--border-brown);
}

.difficulty-bars .bar.active {
    background: var(--green-confirm);
}

#modalDifficulty {
    font-weight: bold;
    color: var(--green-confirm);
}

.file-footer {
    background: var(--ink-black);
    color: var(--sepia);
    text-align: center;
    padding: 0.8rem;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-top: 3px solid var(--red-stamp);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--ink-black);
    border-top: 3px solid var(--sepia);
    color: var(--sepia);
    font-size: 0.9rem;
}

.footer p {
    margin: 0.3rem 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .header {
        padding: 3rem 1.5rem 2rem;
    }
    
    .evidence-board {
        padding: 2rem 1rem;
    }
    
    .close-btn {
        top: 10px;
        right: 10px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes floatSlow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.photo-frame:nth-child(odd) {
    animation: floatSlow 6s ease-in-out infinite;
}

.photo-frame:nth-child(even) {
    animation: floatSlow 7s ease-in-out infinite;
    animation-delay: 0.5s;
}
