/* --- Root Variables & Theme Configuration --- */
:root {
    --primary: #0ea5e9; /* Sky 500 */
    --primary-hover: #0284c7; /* Sky 600 */
    --bg-dark: #0f1115;
    --bg-sidebar: #13161c;
    --bg-card: #181b21;
    --border-color: #2a2e36;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --groq-color: #f55036; /* Groq Brand Color */
}

/* Base Styles */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    overflow: hidden; 
}

/* --- Custom Scrollbar --- */
.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: #0b0f19; }
.custom-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Mobile & Utils */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hidden { display: none !important; }
.disabled-field { opacity: 0.3; pointer-events: none; }

/* --- SLEEK MODERN SLIDERS --- */
input[type=range] { 
    -webkit-appearance: none; 
    width: 100%; 
    background: transparent; 
    cursor: pointer; 
    height: 20px; 
    margin: 5px 0;
}

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track { 
    width: 100%; 
    height: 4px; 
    background: #2a2e36; 
    border-radius: 4px;
    border: none;
    transition: background 0.3s;
}
input[type=range]:hover::-webkit-slider-runnable-track { background: #374151; }

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    height: 16px; 
    width: 16px; 
    border-radius: 50%; 
    background: var(--primary); 
    border: 2px solid #fff; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); 
    margin-top: -6px; 
    transition: all 0.2s ease;
}

/* Slider Animations */
input[type=range]:hover::-webkit-slider-thumb { 
    transform: scale(1.2); 
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}
input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.1);
    background: #fff;
    border-color: var(--primary);
}
input[type=range]:focus { outline: none; }

/* Slider Value Text */
.slider-value-text {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* --- FORM ELEMENTS --- */
.glass-input { 
    background-color: #1f2329; 
    border: 1px solid var(--border-color); 
    color: white; 
    transition: all 0.2s; 
}
.glass-input:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 1px var(--primary); 
}

/* --- BUTTONS --- */
.platform-btn { 
    background: #1e293b; 
    border: 1px solid var(--border-color); 
    color: var(--text-muted); 
    cursor: pointer; 
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.platform-btn:hover { 
    background: #2d3748; 
    color: white; 
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* Button Shine Effect */
.platform-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}
.platform-btn:hover::after { left: 100%; }

/* Active Button State */
.platform-btn.active { 
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-color: var(--primary); 
    color: white; 
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3); 
    font-weight: 700;
}

/* Specific Button Colors */
.btn-adobe:hover { border-color: #ff0000; color: #ffcccc; box-shadow: 0 0 10px rgba(255, 0, 0, 0.2); }
.btn-shutter:hover { border-color: #eb3300; color: #ffd6cc; box-shadow: 0 0 10px rgba(235, 51, 0, 0.2); }
.btn-freepik:hover { border-color: #3b82f6; color: #bfdbfe; box-shadow: 0 0 10px rgba(59, 130, 246, 0.2); }
.btn-general:hover { border-color: #10b981; color: #a7f3d0; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }

/* --- TOGGLE SWITCH --- */
.toggle-checkbox { display: none; }
.toggle-label { 
    width: 40px; height: 20px; 
    position: relative; display: inline-block; 
    background-color: #333; border-radius: 9999px; 
    cursor: pointer; transition: all 0.2s; 
}
.toggle-label:after { 
    content: ''; position: absolute; 
    top: 2px; left: 2px; width: 16px; height: 16px; 
    background-color: white; border-radius: 50%; 
    transition: all 0.2s; 
}
.toggle-checkbox:checked + .toggle-label { background-color: var(--primary); }
.toggle-checkbox:checked + .toggle-label:after { left: calc(100% - 2px); transform: translateX(-100%); }

/* --- ANIMATIONS --- */
.loader { 
    border: 2px solid rgba(255,255,255,0.1); 
    border-top: 2px solid #ffffff; 
    border-radius: 50%; width: 16px; height: 16px; 
    animation: spin 0.8s linear infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }

@keyframes shine { 
    0% { transform: translateX(-150%) skewX(-12deg); } 
    100% { transform: translateX(150%) skewX(-12deg); } 
}
.animate-shine { animation: shine 2s infinite linear; }

/* Profile Image Pulse */
@keyframes pulse-ring {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
.image-animate { animation: pulse-ring 2s infinite; }

/* --- TOAST NOTIFICATIONS --- */
.toast-container { 
    position: fixed; top: 20px; right: 20px; z-index: 1000; 
    display: flex; flex-direction: column; gap: 10px; 
}
.toast { 
    background: #1e293b; border-left: 4px solid var(--primary); 
    padding: 12px 20px; border-radius: 8px; color: white; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); font-size: 0.875rem; 
    display: flex; align-items: center; gap: 12px; min-width: 250px;
    animation: slideInRight 0.3s ease-out; opacity: 1; transform: translateX(0);
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- EXPORT MENU --- */
.export-menu {
    position: absolute; bottom: 100%; right: 0; margin-bottom: 8px;
    background: #1e293b; border: 1px solid var(--border-color);
    border-radius: 8px; width: 200px; padding: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none; flex-direction: column; gap: 2px;
    z-index: 50;
}
.export-menu.show { display: flex; animation: fadeIn 0.15s ease-out; }
.export-item {
    padding: 8px 12px; text-align: left; font-size: 12px; font-weight: 500;
    color: var(--text-muted); border-radius: 4px; transition: all 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.export-item:hover { background: var(--primary); color: white; }

/* --- MODE SPECIFIC --- */
body.app-mode-prompt .meta-field { display: none !important; }
body.app-mode-prompt .desc-container textarea { height: 120px; }

/* --- 16:9 PREVIEW BOX FIXED --- */
.preview-box-fixed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Fixed 16:9 Ratio */
    background-color: #000000;
    border: 1px solid #2a2e36;
    border-radius: 8px;
    overflow: hidden;
    display: flex; 
    align-items: center;
    justify-content: center;
}

.preview-box-fixed img {
    max-width: 100%;
    max-height: 100%;
    width: auto; height: auto;
    object-fit: contain; /* Shows full image */
    display: block;
}

.icon-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%; height: 100%;
}