/* OnRegardeQuoi.com: a lightweight and open-source web app for discovering movies and TV shows */
/* Made with ❤ by micka from Paris */
/* v2.0 */


/* ==========================================
   CSS VARIABLES (COLORS & STYLES)
========================================== */
:root {
    --color-accent: #fbbf24;
    --color-bg-body: #000000; /* Absolute Pure OLED Total Black */
    --color-bg-menu: rgba(18, 18, 18, 0.96); /* Elegant dark gray for panel overlays */
    --color-bg-btn: rgba(30, 30, 30, 0.85); /* Highly readable buttons on pitch black */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-lighter: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   NATIVE FONTS & LAYOUT FIXES
========================================== */
html {
    scrollbar-gutter: stable; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0; padding: 0;
    background-color: var(--color-bg-body);
}

html:has(body.menu-open) {
    overflow: hidden;
}

/* ==========================================
   ANIMATIONS (HARDWARE ACCELERATED)
========================================== */
@keyframes scaleUp { 
    from { transform: scale(0.95) translateZ(0); opacity: 0; } 
    to { transform: scale(1) translateZ(0); opacity: 1; } 
}
@keyframes slideIn { 
    from { transform: translateX(400px) translateZ(0); opacity: 0; } 
    to { transform: translateX(0) translateZ(0); opacity: 1; } 
}

/* ==========================================
   MENU & MAIN BUTTON STYLING
========================================== */
.menu {
    background: var(--color-bg-menu); 
    backdrop-filter: blur(20px); 
    border: 1px solid var(--border-light);
}
.menu.open { animation: scaleUp 0.2s ease-out forwards; } 

#btn {
    background: var(--color-bg-btn); 
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-lighter); 
}
#btn:hover { 
    background: var(--color-bg-menu); 
    border-color: var(--color-accent); 
}

/* ==========================================
   RESPONSIVE POSTER GRID
========================================== */
.poster-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); 
    gap: 12px; 
    padding: 12px;
}
@media (min-width: 640px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 14px; } } 
@media (min-width: 1024px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } } 

/* ==========================================
   POSTER CARD DESIGN
========================================== */
.poster {
    aspect-ratio: 2/3; 
    border-radius: 16px; 
    overflow: hidden; 
    cursor: pointer;
    background: #111; 
    position: relative; 
    border: 2px solid transparent; 
    transition: border 0.2s;
}

/* Hardware accelerate only when the user interacts, preventing mobile crashes */
.poster:hover, .poster.active {
    will-change: transform;
}
.poster img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.2s; }

/* Hover only applied on devices with a real mouse */
@media (hover: hover) {
    .poster:hover { border-color: var(--color-accent); }
    .poster:hover img { filter: brightness(0.6); } 
    .poster:hover .poster-actions { opacity: 1; }
}

/* Active state for touch devices */
.poster.active { border-color: var(--color-accent); }
.poster.active img { filter: brightness(0.6); } 
.poster.active .poster-actions { opacity: 1; }

.poster-actions {
    position: absolute; 
    bottom: 0; left: 0; right: 0; 
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 100%); 
    padding: 40px 8px 8px 8px; 
    display: flex; 
    gap: 6px; 
    justify-content: center;
    opacity: 0; 
    transition: opacity 0.2s;
}
@media (min-width: 640px) { 
    .poster-actions { padding: 40px 12px 12px 12px; gap: 12px; } 
}

.action-btn {
    flex: 1; aspect-ratio: 1; border-radius: 50%;
    max-width: 44px; 
    background: var(--color-bg-btn); backdrop-filter: blur(8px);
    border: 1px solid var(--border-lighter); color: var(--color-accent);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; 
}
.action-btn:hover { 
    background: var(--color-accent); color: #000; 
    border-color: transparent; transform: scale(1.05);
}

.action-btn svg { 
    pointer-events: none; 
    width: 50% !important; 
    height: 50% !important; 
}

/* ==========================================
   NOTIFICATIONS
========================================== */
.notification {
    position: fixed; bottom: 20px; right: 20px; padding: 10px 14px; border-radius: 8px;
    font-size: 13px; z-index: 1000; animation: slideIn 0.3s ease-out forwards; font-weight: 500;
    will-change: transform, opacity;
}
.notification.error { background: #dc2626; color: white; }
.notification.success { background: #16a34a; color: white; }
@media (max-width: 640px) { .notification { bottom: 16px; right: 16px; left: 16px; text-align: center; } }

/* ==========================================
   MODAL INTERIORS (Metadata & Clickable Links)
========================================== */
.details-grid { display: flex; flex-direction: column; gap: 6px; }
.detail-row { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { font-weight: 700; color: var(--color-accent); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }
.detail-value { color: #d1d5db; font-size: 13px; line-height: 1.4; }

/* Interactive metadata style */
.clickable-meta {
    cursor: pointer;
    transition: color 0.2s;
}
.clickable-meta:hover {
    color: var(--color-accent);
}

.videos-list { display: flex; flex-direction: column; gap: 4px; }
.video-item { 
    display: flex; justify-content: space-between; align-items: center; gap: 8px; 
    padding: 8px 10px; background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 6px; 
    cursor: pointer; transition: all 0.2s; 
}
.video-item:hover { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.4); }
.video-title { font-size: 13px; font-weight: 500; color: #f3f4f6; overflow: hidden; text-overflow: ellipsis; }
.video-meta { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-shrink: 0; 
}
.video-date { 
    font-size: 11px; 
    color: #9ca3af; 
}
.video-badge { 
    font-size: 10px; 
    font-weight: 700; 
    padding: 2px 6px; 
    border-radius: 4px; 
    background: rgba(255, 255, 255, 0.1); 
    color: #d1d5db; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.provider-grid { display: flex; flex-direction: column; gap: 12px; }
.provider-type { display: flex; flex-direction: column; gap: 6px; }
.provider-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; }
.provider-list { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-item { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-light); }

/* ==========================================
   YOUTUBE PLAYER FIXES
========================================== */
#player-container { 
    width: 100%; 
    aspect-ratio: 16 / 9; 
    border-radius: 16px; 
    overflow: hidden; 
    border: 2px solid var(--color-accent);
}
lite-youtube { width: 100%; height: 100%; max-width: 100% !important; margin: 0 auto; }
@media (max-width: 768px) { #modal-player { padding: 12px; } }

/* ==========================================
   CUSTOM SCROLLBAR & UI TWEAKS
========================================= */
details summary::-webkit-details-marker { display: none; } 

/* Standard rule for Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Rules for Chrome, Safari, and Edge */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

/* ==========================================================================
   LIGHT MODE RULES
   Forcing layout color overrides cleanly without changing individual HTML utility tags
   ========================================================================== */
body.light {
    background-color: #ffffff !important;
}

/* Modifies panel and dropdown container styles for light color profiles */
body.light .menu {
    background: rgba(249, 250, 251, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Forces dark text on text classes that are hardcoded white/gray in the HTML */
body.light .text-white, 
body.light input,
body.light input::placeholder,
body.light .menu button,
body.light .detail-value,
body.light .video-title {
    color: #111827 !important;
}

body.light .text-gray-300 {
    color: #374151 !important;
}

/* Alters transparent dark utility borders and background cards to light modes */
body.light .bg-white\/5 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}
body.light .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
body.light .divide-white\/10 > * + * {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
body.light .divide-white\/5 > * + * {
    border-color: rgba(0, 0, 0, 0.04) !important;
}

/* Keep action buttons readable on white layouts */
body.light #btn {
    background: rgba(243, 244, 246, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}
