/* ========================================
   z0r Archive Player - Styles
   ======================================== */

/* === BASE RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === ROOT & BODY === */
html, body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #e0e0e0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    display: flex;
    flex-direction: column;
}

/* === PAGE CONTAINER === */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    background: radial-gradient(ellipse at top, #1a1a1a, #000000);
}

/* === HEADER === */
.header {
    padding: 0.6rem 1rem;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    border-bottom: 1px solid #00ff00;
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5), 
                 0 0 20px rgba(0, 255, 0, 0.3);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.header-info {
    font-size: 0.9rem;
    color: #b0b0b0;
    text-align: right;
    min-width: 120px;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.header-info span {
    color: #00ff00;
    font-weight: 600;
}

/* === PLAYER CONTAINER === */
.player-container {
    flex: 0 0 auto;
    background: #000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: 0.25rem 0.5rem;
    min-height: auto;
    cursor: pointer;
}

#ruffle-container {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.2);
}

#ruffle-container ruffle-player {
    width: 100%;
    height: 100%;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: absolute;
    inset: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.loading-text {
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5),
                inset 0 0 20px rgba(0, 255, 0, 0.1);
    font-size: 1rem;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    font-weight: 500;
    letter-spacing: 1px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* === AUDIO ENABLE OVERLAY === */
.audio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    animation: fadeIn 0.5s ease;
    transition: opacity 0.3s ease;
}

.audio-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.audio-overlay-content {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1) 0%, rgba(0, 200, 0, 0.05) 100%);
    border: 2px solid rgba(0, 255, 0, 0.4);
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.3),
                inset 0 0 40px rgba(0, 255, 0, 0.05);
    position: relative;
    max-width: 400px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.audio-overlay-content h2 {
    color: #00ff00;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

.audio-overlay-content p {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.audio-pulse {
    position: absolute;
    inset: -20px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-radius: 24px;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseRing {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* === CONTROLS SECTION === */
.controls {
    padding: 0.75rem 0.75rem 0.5rem;
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
    border-top: 2px solid #00ff00;
    box-shadow: 0 -4px 15px rgba(0, 255, 0, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

/* === BUTTONS === */
.btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #fff;
    border: 2px solid #00ff00;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    color: #000;
    border-color: #00ff00;
    box-shadow: 0 6px 25px rgba(0, 255, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 255, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-color: #00cc00;
    min-width: auto;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
}

/* === AUTOPLAY BUTTON === */
.btn-autoplay {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-color: #00ff00;
    min-width: 140px;
}

.btn-autoplay.active {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    color: #000;
    font-weight: 700;
}

.btn-autoplay:hover {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
}

/* === AUTOPLAY SPEED SELECTOR === */
.autoplay-speed-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(5px);
}

.autoplay-speed {
    background: transparent;
    color: #00ff00;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.autoplay-speed option {
    background: #1a1a1a;
    color: #00ff00;
}

/* === CONTENT SOURCE SELECTOR === */
.content-source-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(5px);
}

.content-source {
    background: transparent;
    color: #00ff00;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.content-source option {
    background: #1a1a1a;
    color: #00ff00;
}

/* === CONTENT SOURCE MENU === */
.content-source-container {
    position: relative;
}

.content-source-toggle {
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.15) 0%, rgba(0, 200, 0, 0.1) 100%);
    color: #00ff00;
    border: 2px solid rgba(0, 255, 0, 0.4);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.content-source-toggle:hover {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.25) 0%, rgba(0, 200, 0, 0.2) 100%);
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.content-source-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 2px solid rgba(0, 255, 0, 0.4);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 -4px 20px rgba(0, 255, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.content-source-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.source-option {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    color: #aaa;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s ease;
    margin-bottom: 0.3rem;
}

.source-option:hover {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
}

.source-option.active {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    font-weight: 600;
}

.menu-divider {
    height: 1px;
    background: rgba(0, 255, 0, 0.2);
    margin: 0.5rem 0;
}

.numeric-input-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.numeric-input-menu span {
    font-size: 0.9rem;
    color: #00ff00;
    font-weight: 600;
}

.numeric-input-menu input {
    flex: 1;
    min-width: 80px;
    padding: 0.4rem;
    border: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    font-family: inherit;
    border-radius: 6px;
}

.numeric-input-menu input::placeholder {
    color: #666;
}

/* === NUMERIC INPUT (HIDDEN) === */
.numeric-input {
    display: none;
}

/* === FOOTER HINT === */
.footer-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #aaa;
    padding: 0.6rem 1rem;
    background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    line-height: 1.5;
}

.footer-hint::before {
    content: '⌨️ ';
    margin-right: 0.5rem;
}

.footer-keyboard,
.footer-touch,
.footer-separator {
    display: inline;
}

/* === DESKTOP RESPONSIVE === */
@media (min-width: 1024px) {
    #ruffle-container {
        max-height: calc(100vh - 260px);
    }
    
    .player-container {
        padding: 1rem;
    }
    
    .controls {
        padding: 1rem;
    }
    
    .footer-hint {
        font-size: 0.85rem;
        padding: 0.8rem 1.5rem;
    }
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .header {
        padding: 0.3rem 0.5rem;
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        border-bottom: 1px solid #00ff00;
    }

    .header-title {
        flex: 1;
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .header-info {
        text-align: right;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        min-width: auto;
    }

    .player-container {
        padding: 0.25rem 0.4rem 0.2rem;
    }

    #ruffle-container {
        aspect-ratio: 4 / 3;
        max-height: calc(100vh - 220px);
        min-height: 180px;
        border-radius: 3px;
    }

    .controls {
        padding: 0.4rem 0.4rem 0.3rem;
        gap: 0.35rem;
        border-top: 1px solid #00ff00;
    }

    .btn {
        flex: 1 1 calc(33.333% - 0.35rem);
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.45rem 0.5rem;
    }

    .btn-autoplay {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 0;
    }

    .autoplay-speed-container {
        flex: 1 1 calc(50% - 0.35rem);
        padding: 0.3rem 0.6rem;
        justify-content: center;
    }

    .autoplay-speed-container {
        flex: 1 1 calc(50% - 0.35rem);
        padding: 0.3rem 0.6rem;
        justify-content: center;
    }

    .autoplay-speed {
        font-size: 0.8rem;
    }

    .content-source-container {
        flex: 1 1 100%;
        padding: 0.3rem 0.6rem;
        justify-content: center;
    }

    .content-source {
        font-size: 0.8rem;
    }

    .numeric-input {
        width: 100%;
        justify-content: space-between;
        padding: 0.25rem 0.6rem;
    }

    .numeric-input input {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
    }

    .footer-hint {
        font-size: 0.75rem;
        padding: 0.5rem 0.5rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.25rem 0.4rem;
    }

    .header-title {
        font-size: 0.8rem;
    }

    .header-info {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .player-container {
        padding: 0.2rem 0.3rem 0.15rem;
    }

    #ruffle-container {
        max-height: calc(100vh - 200px);
        min-height: 160px;
        border-radius: 2px;
    }

    .controls {
        padding: 0.35rem 0.35rem 0.25rem;
        gap: 0.3rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.45rem;
    }

    .btn-autoplay {
        font-size: 0.75rem;
    }

    .autoplay-speed {
        font-size: 0.75rem;
    }

    .content-source {
        font-size: 0.75rem;
    }

    .footer-hint {
        font-size: 18px !important;
        padding: 20px 16px !important;
        color: #ffffff !important;
        line-height: 2 !important;
        background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%) !important;
        border-top: 3px solid rgba(0, 255, 0, 0.6) !important;
        box-shadow: 0 -2px 12px rgba(0, 255, 0, 0.2) !important;
        font-weight: 700 !important;
        min-height: 120px !important;
    }
    
    .footer-hint::before {
        display: block !important;
        margin: 0 0 12px 0 !important;
        font-size: 24px !important;
    }
    
    .footer-keyboard,
    .footer-touch {
        display: block !important;
        margin: 10px 0 !important;
        font-size: 18px !important;
        font-weight: 700 !important;
    }
    
    .footer-separator {
        display: none !important;
    }
}

/* === COMMENTS SECTION === */
.comments-section {
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    border-top: 2px solid rgba(0, 255, 0, 0.3);
    padding: 2rem 1rem;
}

.comments-container {
    max-width: 960px;
    margin: 0 auto;
}

.comments-title {
    color: #00ff00;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#disqus_thread {
    background: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

@media (max-width: 768px) {
    .comments-section {
        padding: 1.5rem 0.75rem;
    }
    
    .comments-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    #disqus_thread {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .comments-section {
        padding: 1rem 0.5rem;
    }
    
    .comments-title {
        font-size: 1rem;
    }
    
    #disqus_thread {
        padding: 0.75rem;
    }
}

/* === SCROLLBAR STYLING === */
/* Hide scrollbar completely in fullscreen */
:fullscreen ::-webkit-scrollbar,
:-webkit-full-screen ::-webkit-scrollbar,
:-moz-full-screen ::-webkit-scrollbar {
    display: none;
}

:fullscreen,
:-webkit-full-screen,
:-moz-full-screen {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
