/*
 * File: media-style.css
 * Description: Styles for AI Media Generator
 * Version: 1.0.0
 */

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --vidnok-glass: rgba(255, 255, 255, 0.05); 
    --vidnok-border: rgba(255, 255, 255, 0.15); 
    --vidnok-primary: #a855f7;
    --vidnok-secondary: #ec4899;
    --vidnok-text-main: #ffffff; 
    --vidnok-text-muted: #cbd5e1;
    --bg-dark: #0f172a;
    --input-bg: rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--vidnok-text-main);
    line-height: 1.6;
    margin: 0; padding: 0;
    height: 100vh; 
    overflow: hidden; 
}

a { text-decoration: none; transition: 0.3s; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
.wp-site-blocks > footer, .site-footer, #colophon { display: none !important; }

/* =========================================
   2. BACKGROUND ANIMATION
   ========================================= */
.vidnok-fixed-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 50%, #2e1065 0%, #0f172a 100%);
    z-index: -999; pointer-events: none;
}
.vidnok-fixed-bg::before { content: ''; position: absolute; width: 60vw; height: 60vh; background: #a855f7; top: -10%; left: -10%; border-radius: 50%; filter: blur(100px); opacity: 0.5; z-index: -1; animation: vidnokPulse 8s infinite alternate; }
.vidnok-fixed-bg::after { content: ''; position: absolute; width: 60vw; height: 60vh; background: #ec4899; bottom: -10%; right: -10%; border-radius: 50%; filter: blur(100px); opacity: 0.5; z-index: -1; animation: vidnokPulse 8s infinite alternate; }
@keyframes vidnokPulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.1); opacity: 0.7; } }

/* =========================================
   3. HEADER
   ========================================= */
.vidnok-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--vidnok-border);
}

.vidnok-logo a { font-size: 1.5rem; font-weight: 800; color: white; text-transform: uppercase; display: flex; align-items: center; }
.vidnok-logo img { height: 40px; width: auto; }

.vidnok-nav { display: flex; gap: 30px; position: absolute; left: 50%; transform: translateX(-50%); }
.vidnok-nav a { color: var(--vidnok-text-muted); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }
.vidnok-nav a:hover, .vidnok-nav a.active { color: white; text-shadow: 0 0 15px var(--vidnok-primary); }

.v-cta-btn {
    background: rgba(255,255,255,0.1); border: 1px solid var(--vidnok-border);
    padding: 8px 20px; border-radius: 50px; color: white; font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; gap: 5px;
}
.vidnok-mobile-trigger { display: none; }

@media (max-width: 900px) {
    .vidnok-nav, .v-cta-btn { display: none !important; }
    .vidnok-header { padding: 0 20px; justify-content: flex-start; }
    .vidnok-mobile-trigger { display: flex; align-items: center; z-index: 1002; }
    .vidnok-logo { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; z-index: 1001; }
    .vidnok-menu-btn { 
        background: rgba(255,255,255,0.1); border: 1px solid var(--vidnok-border);
        border-radius: 8px; cursor: pointer; padding: 8px 12px; color: white; font-size: 1.2rem; 
    }
}

/* =========================================
   4. SIDEBAR (MOBILE MENU)
   ========================================= */
.vidnok-sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    z-index: 2000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.vidnok-sidebar-overlay.active { opacity: 1; visibility: visible; }

.vidnok-mobile-sidebar {
    position: fixed; top: 0; left: 0; height: 100%; width: 300px;
    background: radial-gradient(circle at 0% 0%, #4c1d95 0%, #0f172a 100%);
    border-right: 1px solid var(--vidnok-border);
    box-shadow: 10px 0 50px rgba(0,0,0,0.5);
    z-index: 2001; transform: translateX(-100%); transition: 0.4s;
    padding: 30px; display: flex; flex-direction: column;
}
.vidnok-mobile-sidebar.active { transform: translateX(0); }

.vidnok-sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 40px; border-bottom: 1px solid var(--vidnok-border); padding-bottom: 20px;
}
.v-menu-title { font-weight: 800; color: white; letter-spacing: 1px; }
.v-close-btn { color: white; font-size: 1.5rem; cursor: pointer; }

.vidnok-sidebar-links a {
    display: flex; align-items: center; padding: 15px 20px;
    color: var(--vidnok-text-muted); font-weight: 700; text-transform: uppercase;
    border-radius: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--vidnok-border);
    margin-bottom: 10px; transition: 0.3s;
}
.vidnok-sidebar-links a i { width: 24px; text-align: center; margin-right: 15px; color: white; }
.vidnok-sidebar-links a:hover, .vidnok-sidebar-links a.active {
    color: white; background: rgba(168, 85, 247, 0.25); border-color: var(--vidnok-primary);
}

/* =========================================
   5. MEDIA LAYOUT (DESKTOP)
   ========================================= */
.vidnok-container {
    max-width: 1400px; margin: 0 auto; 
    padding: 95px 20px 10px; 
    height: 100vh;
    display: flex; 
    flex-direction: column;
    box-sizing: border-box;
}

.vidnok-layout-row { 
    display: flex; 
    gap: 25px; 
    height: 100%; 
    overflow: hidden; 
    padding-bottom: 10px;
}

/* --- LEFT SIDEBAR (SETTINGS) --- */
.vidnok-sidebar-col { 
    width: 320px;
    flex-shrink: 0;
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    
    height: 100%;
    overflow-y: auto; 
    padding-right: 5px; 
    padding-bottom: 20px;
}

/* --- RIGHT CONTENT (PROMPT + GALLERY) --- */
.vidnok-content-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

.vidnok-prompt-area {
    flex-shrink: 0; 
}

/* =========================================
   6. COMPONENT STYLES
   ========================================= */

.vidnok-setting-card {
    background: var(--vidnok-glass);
    border: 1px solid var(--vidnok-border);
    border-radius: 16px; padding: 15px;
    backdrop-filter: blur(15px);
}

.vidnok-label {
    font-size: 0.8rem; font-weight: 800; color: var(--vidnok-text-muted);
    margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.vidnok-info-icon { font-size: 12px; cursor: help; color: var(--vidnok-primary); }

.vidnok-input-select, .vidnok-input-file, .vidnok-input-small {
    width: 100%; padding: 10px; border-radius: 10px;
    background: var(--input-bg); border: 1px solid var(--vidnok-border);
    color: white; outline: none; transition: 0.3s; font-size: 0.9rem;
    cursor: pointer;
}
.vidnok-input-select:focus, .vidnok-input-file:focus {
    border-color: var(--vidnok-primary); box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Button Grids */
.vidnok-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vidnok-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vidnok-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.vidnok-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }

.vidnok-btn-option {
    background: rgba(255,255,255,0.05); border: 1px solid var(--vidnok-border);
    color: var(--vidnok-text-muted); padding: 8px; border-radius: 8px;
    cursor: pointer; transition: 0.3s; font-size: 0.8rem; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.vidnok-btn-option:hover { background: rgba(255,255,255,0.1); color: white; }
.vidnok-btn-option.active, .vidnok-btn-option.active-fill {
    background: var(--vidnok-primary); color: white; border-color: var(--vidnok-primary);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* ASPECT RATIO BUTTONS */
.vidnok-size-btn {
    height: 60px; 
    gap: 6px;
    position: relative;
}

.v-ratio-icon {
    display: block; 
    border: 2px solid rgba(255,255,255,0.3); 
    border-radius: 2px; 
    transition: 0.3s;
    box-sizing: border-box;
}

.active .v-ratio-icon { 
    border-color: #fff; 
    background: rgba(255,255,255,0.3); 
}

/* Shapes */
.v-2-3 { width: 12px; height: 18px; }  
.v-1-1 { width: 16px; height: 16px; }  
.v-16-9 { width: 20px; height: 11px; } 
.v-ratio-text { font-size: 0.7rem; font-weight: 700; }

.vidnok-btn-text-sm { font-size: 10px; font-weight: 400; opacity: 0.8; margin-top: 2px; }

/* Image Upload Preview */
#vidnok-image-preview img {
    width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--vidnok-border);
    margin-top: 10px;
}

/* --- MAIN AREA (Prompt) --- */
.vidnok-prompt-area {
    background: var(--vidnok-glass);
    border: 1px solid var(--vidnok-border);
    border-radius: 20px; padding: 20px;
    backdrop-filter: blur(15px);
}

.vidnok-prompt-input {
    width: 100%; min-height: 120px; padding: 15px;
    background: var(--input-bg); border: 1px solid var(--vidnok-border);
    border-radius: 12px; color: white; font-size: 1rem; resize: none; outline: none;
    transition: 0.3s;
}
.vidnok-prompt-input:focus { border-color: var(--vidnok-primary); box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }

.vidnok-gen-toolbar {
    display: flex; justify-content: space-between; align-items: center; margin-top: 15px;
}
.vidnok-word-counter { color: var(--vidnok-text-muted); font-size: 0.8rem; }

.vidnok-btn-generate {
    background: linear-gradient(90deg, var(--vidnok-primary), var(--vidnok-secondary));
    color: white; padding: 12px 30px; border-radius: 50px;
    font-weight: 800; text-transform: uppercase; border: none; cursor: pointer;
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.4); transition: 0.3s;
    display: flex; align-items: center; gap: 8px; font-size: 0.9rem;
}
.vidnok-btn-generate:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(168, 85, 247, 0.6); }
.vidnok-btn-generate:disabled { opacity: 0.6; cursor: not-allowed; }

.vidnok-credit-badge {
    background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 20px; font-size: 0.75rem;
}

/* =========================================
   7. GALLERY OUTPUT (SCROLLABLE & COMPACT)
   ========================================= */
.vidnok-output-area {
    background: var(--vidnok-glass);
    border: 1px solid var(--vidnok-border);
    border-radius: 20px; padding: 20px;
    backdrop-filter: blur(15px);
    
    display: flex;
    flex-direction: column;
    flex: 1; 
    overflow: hidden; 
}

.vidnok-gallery-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--vidnok-border); padding-bottom: 10px; margin-bottom: 15px;
    flex-shrink: 0;
}
.vidnok-gallery-header h3 { font-size: 1.1rem; font-weight: 800; color: white; margin: 0; }

/* Grid System */
.vidnok-gallery-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 12px;
    
    overflow-y: auto; 
    height: 100%;
    padding-right: 5px;
    padding-bottom: 20px;
}

/* Empty State */
.vidnok-empty-state {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed var(--vidnok-border); border-radius: 16px;
    height: 100%; 
    min-height: 250px;
    color: var(--vidnok-text-muted);
    background: rgba(255,255,255,0.02);
}
.vidnok-empty-state i { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.5; color: var(--vidnok-primary); }

/* --- RESULT CARD --- */
.vidnok-result-card {
    position: relative; 
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid var(--vidnok-border);
    background: #000;
    transition: transform 0.3s;
    width: 100%;
    aspect-ratio: 1/1; 
}
.vidnok-result-card:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); z-index: 5; }

.vidnok-result-img, .vidnok-result-video { 
    width: 100%; height: 100%; object-fit: cover; display: block; 
}
.vidnok-video-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* Overlay */
.vidnok-card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0; transition: 0.3s;
    display: flex; justify-content: center;
}
.vidnok-result-card:hover .vidnok-card-overlay { opacity: 1; }

.vidnok-btn-small {
    background: white; color: black; font-size: 0.7rem; font-weight: 800;
    padding: 6px 12px; border-radius: 20px; text-decoration: none;
    display: flex; align-items: center; gap: 4px; cursor: pointer;
}
.vidnok-btn-small:hover { background: var(--vidnok-secondary); color: white; }

/* --- LOADING CARD --- */
.vidnok-loading-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--vidnok-border);
    border-radius: 12px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1/1;
}

.vidnok-loading-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), transparent);
    animation: vidnokPulseBg 2s infinite alternate; z-index: 1;
}

.vidnok-loading-content {
    z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.vidnok-loading-icon {
    font-size: 2rem; color: var(--vidnok-primary);
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.6));
}

.vidnok-loading-text {
    font-size: 0.8rem; font-weight: 700; color: white;
    letter-spacing: 1px; margin: 0; text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

@keyframes vidnokPulseBg { 0% { opacity: 0.3; } 100% { opacity: 0.8; } }

/* --- SCROLLBAR STYLING --- */
.vidnok-sidebar-col::-webkit-scrollbar,
.vidnok-gallery-grid::-webkit-scrollbar {
    width: 5px;
}
.vidnok-sidebar-col::-webkit-scrollbar-track,
.vidnok-gallery-grid::-webkit-scrollbar-track {
    background: transparent;
}
.vidnok-sidebar-col::-webkit-scrollbar-thumb,
.vidnok-gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.vidnok-sidebar-col:hover::-webkit-scrollbar-thumb,
.vidnok-gallery-grid:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================
   8. MOBILE RESPONSIVE (SCROLL & BORDER FIX)
   ========================================= */
@media (max-width: 900px) {
    /* Un-lock Body Scroll */
    body {
        height: auto !important; 
        overflow-y: auto !important; 
    }

    .vidnok-container { 
        height: auto; 
        display: block; 
        padding-top: 100px;
        padding-bottom: 40px;
    }
    
    .vidnok-layout-row { 
        flex-direction: column; 
        height: auto; 
        overflow: visible; 
        gap: 30px;
    }
    
    .vidnok-sidebar-col { 
        width: 100%; 
        height: auto; 
        overflow: visible; 
        padding-bottom: 0;
        padding-right: 0;
        order: 2; 
    }
    
    .vidnok-content-col { 
        height: auto; 
        overflow: visible;
        order: 1; 
    }
    
    /* Hidden overflow prevents border leak */
    .vidnok-output-area { 
        min-height: 400px; 
        height: auto;
        overflow: hidden; 
    }
    
    /* Fixed height for empty state */
    .vidnok-empty-state {
        height: 300px; 
        min-height: 0; 
    }
    
    .vidnok-gallery-grid { 
        height: auto; 
        overflow: visible; 
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
        padding-right: 0;
    }
}

/* Footer */
.vidnok-custom-footer {
    text-align: center; padding: 40px; color: var(--vidnok-text-muted);
    border-top: 1px solid var(--vidnok-border); margin-top: auto;
    font-size: 0.9rem; background: rgba(15, 23, 42, 0.3);
}