@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --accent: #0ea5e9;
    --dark: #0f172a;
    --bg-app: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.85);
    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Glassmorphism Cards */
.card-omnia {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s ease;
}

/* Custom Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 0.75rem;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* Navbar & Top Navigation */
.navbar {
    background: var(--dark) !important;
}

.top-nav {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-premium);
}

.btn-tab {
    border-radius: 0.75rem;
    padding: 8px 12px;
    color: #64748b;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-tab .tiny-text {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

/* Premium Loader */
.loader-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner-premium {
    width: 60px; height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loaderText {
    margin-top: 20px;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Camera & Overlays */
.camera-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: black;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#videoElement { width: 100%; max-height: 70vh; object-fit: cover; }
.camera-controls { position: absolute; bottom: 40px; display: flex; flex-direction: column; align-items: center; }

/* Alerts */
.alert-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    min-width: 280px;
}

/* Forms */
.form-control {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
}

/* Modal Personalizado */
.modal-backdrop-custom { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); z-index: 9000; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-content-custom { background: white; border-radius: 1.5rem; padding: 2.5rem; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.controls-panel { padding: 0.5rem 1rem !important; }
.form-range-sm::-webkit-slider-thumb { width: 0.8rem; height: 0.8rem; margin-top: -0.25rem; }
.form-range-sm::-webkit-slider-runnable-track { height: 0.3rem; }

.tiny-text { font-size: 0.6rem; letter-spacing: 0.05em; font-weight: 800; }
.x-small { font-size: 0.7rem; }
.tracking-widest { letter-spacing: 0.1em; }
.cursor-pointer { cursor: pointer; }
.hover-underline:hover { text-decoration: underline; }

.modal-content-custom-large { 
    background: #0f172a; 
    color: white; 
    border-radius: 1.25rem; 
    padding: 1rem; 
    max-width: 600px; 
    width: 100%; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(255,255,255,0.1); 
}

.editor-container { width: 100%; height: 320px; background: #000; border-radius: 0.75rem; overflow: hidden; position: relative; border: 1px solid #334155; }

/* Degradados para Filtros de Color Complementarios (Chrome/Safari) */
.range-red::-webkit-slider-runnable-track { background: linear-gradient(to right, #00ffff, #ff0000) !important; height: 6px; border-radius: 3px; }
.range-green::-webkit-slider-runnable-track { background: linear-gradient(to right, #ff00ff, #00ff00) !important; height: 6px; border-radius: 3px; }
.range-blue::-webkit-slider-runnable-track { background: linear-gradient(to right, #ffff00, #0000ff) !important; height: 6px; border-radius: 3px; }

/* Degradados para Filtros de Color Complementarios (Firefox) */
.range-red::-moz-range-track { background: linear-gradient(to right, #00ffff, #ff0000) !important; height: 6px; border-radius: 3px; }
.range-green::-moz-range-track { background: linear-gradient(to right, #ff00ff, #00ff00) !important; height: 6px; border-radius: 3px; }
.range-blue::-moz-range-track { background: linear-gradient(to right, #ffff00, #0000ff) !important; height: 6px; border-radius: 3px; }

.form-range-sm::-webkit-slider-thumb { background: #fff; border: 2px solid #2563eb; width: 14px; height: 14px; margin-top: -4px; cursor: pointer; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.form-range-sm::-moz-range-thumb { background: #fff; border: 2px solid #2563eb; width: 14px; height: 14px; cursor: pointer; box-shadow: 0 0 5px rgba(0,0,0,0.5); }

/* Optimización Móvil y Orientación */
@media (max-width: 768px) {
    .modal-backdrop-custom { padding: 0; }
    .modal-content-custom-large {
        max-width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
    }
    .editor-container {
        flex: 1;
        height: auto !important;
        margin-bottom: 0.5rem !important;
    }
    .controls-panel {
        padding: 0.4rem 0.6rem !important;
        margin-bottom: 0.5rem !important;
    }
    .tiny-text {
        font-size: 0.55rem !important;
    }
    .row.g-1 {
        --bs-gutter-x: 0.25rem;
    }
    .btn-sm {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* MENÚ VERTICAL LATERAL (Sólo en Vertical) */
@media (orientation: portrait) {
    #navContainer {
        position: fixed !important;
        left: 0 !important;
        top: 56px !important;
        bottom: 0 !important;
        width: 70px !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 1000;
        border-right: 1px solid rgba(0,0,0,0.1);
        border-radius: 0 !important;
        background: var(--dark) !important;
    }

    .top-nav {
        height: 100% !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .top-nav > div {
        flex-direction: column !important;
        justify-content: flex-start !important;
        padding: 10px 0 !important;
        gap: 10px;
    }

    #adminTabs {
        flex-direction: column !important;
    }

    .btn-tab {
        width: 100% !important;
        padding: 12px 5px !important;
        color: rgba(255,255,255,0.6) !important;
        border-radius: 0 !important;
    }

    .btn-tab.active {
        background: var(--primary) !important;
        color: white !important;
        border-left: 4px solid var(--accent) !important;
    }

    #root {
        margin-left: 70px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: calc(100% - 70px) !important;
        max-width: none !important;
    }

    .navbar {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1100;
    }

    body {
        padding-top: 56px;
    }
    
    .btn-tab i {
        font-size: 1.2rem !important;
    }
    
    .btn-tab .tiny-text {
        font-size: 0.5rem !important;
        letter-spacing: 0;
    }
}
