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

body {
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Dynamic background image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    filter: blur(10px);
    z-index: -1;
    transition: background-image 0.5s ease, opacity 0.5s ease;
}

/* Desktop/Horizontal Layout */
.desktop-layout {
    display: block;
    position: relative;
    width: 100vw;
    height: 100vh;
}

.mobile-layout {
    display: none;
}

/* Hide mobile X button on desktop */
.mobile-x-button-container {
    display: none;
}

/* Logo positioning */
.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.logo {
    width: 200px;
    height: auto;
}

/* X button for hidden mode */
.x-button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.x-btn {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.x-btn:hover {
    transform: scale(1.1);
}

/* Follow button positioning - below gallery, close to frame */
.follow-container {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.follow-btn {
    height: 70px;
    width: auto;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.follow-btn:hover {
    transform: scale(1.1);
}

/* Main content area */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
}

/* Quote text */
.quote-text {
    font-size: 24px;
    margin-bottom: 40px;
    text-align: center;
    font-weight: normal;
}

/* Gallery container */
.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* Arrow buttons */
.arrow-left, .arrow-right {
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.arrow-left:hover, .arrow-right:hover {
    transform: scale(1.1);
}

.arrow-left img, .arrow-right img {
    width: 80px;
    height: 80px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Frame and photo container */
.frame-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame {
    width: 600px;
    height: auto;
    z-index: 2;
    position: relative;
}

.photo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 520px;
    height: 350px;
    overflow: hidden;
}

.current-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

/* Boobo animation */
.boobo-animation {
    position: absolute;
    bottom: 20px;
    right: -150px;
    z-index: 5;
    animation: moveLeft 15s linear infinite;
}

.boobo-character {
    width: 120px;
    height: auto;
}

@keyframes moveLeft {
    0% {
        right: -150px;
    }
    100% {
        right: 100vw;
    }
}

/* Glitch overlay effect */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glitch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.glitch-overlay.active {
    opacity: 1;
    animation: glitchFlash 0.3s ease-in-out;
}

@keyframes glitchFlash {
    0% { opacity: 0; }
    20% { opacity: 0.8; }
    40% { opacity: 0.3; }
    60% { opacity: 0.9; }
    80% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* Mobile/Vertical Layout */
@media (orientation: portrait) or (max-width: 768px) {
    .desktop-layout {
        display: none;
    }
    
    .mobile-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        padding: 20px;
        gap: 30px;
        transform: translateY(-7%);
    }
    
    /* Ensure glitch overlay works on mobile */
    .glitch-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 999;
        pointer-events: none;
    }
    
    /* Mobile logo */
    .mobile-logo-container {
        text-align: center;
    }
    
    .mobile-logo {
        width: 180px;
        height: auto;
    }
    
    /* Mobile X button for hidden mode */
    .mobile-x-button-container {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10;
        cursor: pointer;
        display: block;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-x-btn {
        width: 50px;
        height: 50px;
        transition: transform 0.3s ease;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-x-btn:hover {
        transform: scale(1.1);
    }
    
    /* Mobile quote text */
    .mobile-quote-text {
        font-size: 18px;
        text-align: center;
        font-weight: normal;
    }
    
    /* Mobile frame container */
    .mobile-frame-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-frame {
        width: 350px;
        height: auto;
        z-index: 2;
        position: relative;
    }
    
    .mobile-photo-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        width: 300px;
        height: 200px;
        overflow: hidden;
    }
    
    .mobile-current-photo {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 0.5s ease;
    }
    
    /* Mobile controls */
    .mobile-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 25px;
    }
    
    /* Mobile arrows side by side */
    .mobile-arrows {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 60px;
    }
    
    .mobile-arrow-left, .mobile-arrow-right {
        cursor: pointer;
        transition: transform 0.3s ease;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-arrow-left:hover, .mobile-arrow-right:hover {
        transform: scale(1.1);
    }
    
    .mobile-arrow-left img, .mobile-arrow-right img {
        width: 60px;
        height: 60px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Mobile follow button */
    .mobile-follow {
        display: flex;
        justify-content: center;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-follow-btn {
        height: 40px;
        width: auto;
        transition: transform 0.3s ease;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-follow-btn:hover {
        transform: scale(1.1);
    }
    
    /* Mobile bottom text */
    .mobile-bottom-text {
        font-size: 16px;
        text-align: center;
        font-weight: normal;
    }
}

/* Smaller mobile screens */
@media (max-width: 480px) {
    .mobile-layout {
        gap: 20px;
        padding: 15px;
    }
    
    .mobile-logo {
        width: 150px;
    }
    
    .mobile-x-btn {
        width: 40px;
        height: 40px;
    }
    
    .mobile-quote-text {
        font-size: 16px;
    }
    
    .mobile-frame {
        width: 280px;
    }
    
    .mobile-photo-container {
        width: 240px;
        height: 160px;
    }
    
    .mobile-controls {
        gap: 30px;
    }
    
    .mobile-arrow-left img, .mobile-arrow-right img {
        width: 50px;
        height: 50px;
    }
    
    .mobile-close img {
        width: 40px;
        height: 40px;
    }
    
    .mobile-bottom-text {
        font-size: 14px;
    }
}

/* Hidden mode styles */
.hidden-mode {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.hidden-mode.active {
    display: flex;
}

.favicon-container {
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.favicon-image {
    width: 120px;
    height: 120px;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.favicon-image:hover {
    transform: scale(1.1);
}

.favicon-image.selected {
    outline: 2px solid #fff;
    outline-offset: 5px;
}

.favicon-text {
    font-family: 'Courier New', monospace;
    font-size: 28px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 3px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hidden-mode-instruction {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #666;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Desktop instruction - show only on desktop */
.desktop-instruction {
    display: block;
}

.mobile-instruction {
    display: none;
}

/* Mobile instruction - show only on mobile/portrait */
@media (orientation: portrait) or (max-width: 768px) {
    .desktop-instruction {
        display: none;
    }
    
    .mobile-instruction {
        display: block;
    }
}

/* Fade transition for photo changes */
.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}
