/* ==========================================================================
   Dark Glassmorphism Design System (SmartSites Aesthetic)
   Rules defined in .agents/rules/dark-glassmorphism-style.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --primary-color: #6366f1;
    --secondary-color: #a855f7;
    --primary-glow: 0 8px 25px rgba(99, 102, 241, 0.4);
    --neon-focus-glow: 0 0 20px rgba(167, 139, 250, 0.35);

    /* Glass Tokens */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: 1px solid rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --glass-pill-bg: rgba(255, 255, 255, 0.05);
    --glass-pill-border: 1px solid rgba(255, 255, 255, 0.12);

    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    /* Indicator Colors */
    --neon-green: #34d399;
    --neon-green-bg: rgba(52, 211, 153, 0.12);
    --neon-green-glow: 0 0 12px rgba(52, 211, 153, 0.25);

    --neon-amber: #fbbf24;
    --neon-amber-bg: rgba(251, 191, 36, 0.12);
    --neon-amber-glow: 0 0 12px rgba(251, 191, 36, 0.25);

    --neon-red: #f87171;
    --neon-red-bg: rgba(248, 113, 113, 0.12);
    --neon-red-glow: 0 0 12px rgba(248, 113, 113, 0.25);
}

/* Base Body Styles */
body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* Ambient Glow Animation */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(90px);
    opacity: 0.45;
    animation: moveBlob 22s infinite alternate ease-in-out;
    border-radius: 50%;
}

.blob-1 {
    top: -15%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: #4f46e5;
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: #7c3aed;
}

.blob-3 {
    top: 35%;
    left: 25%;
    width: 45vw;
    height: 45vw;
    background: #0284c7;
    animation-delay: -6s;
    opacity: 0.3;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(60px, 70px) scale(1.12);
    }

    100% {
        transform: translate(-50px, -50px) scale(0.92);
    }
}

/* Glass Panels & Cards (.glass-card & .glass-panel) */
.glass-panel,
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Glass Pill Base */
.glass-pill {
    background: var(--glass-pill-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--glass-pill-border);
    border-radius: 50px;
    color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.glass-pill-badge {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Metric & Image Cards (.metric-box) */
.metric-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.25s ease;
}

.metric-box:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn-gradient-primary,
.btn-start {
    background: var(--primary-gradient);
    border-radius: 50px;
    color: #ffffff !important;
    border: none;
    box-shadow: var(--primary-glow);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover,
.btn-start:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.55);
    color: #ffffff !important;
}

.btn-gradient-primary:disabled,
.btn-start:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-glass-danger {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: var(--neon-red) !important;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.btn-glass-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: var(--neon-red);
    box-shadow: var(--neon-red-glow);
}

/* Titles and Gradients */
.text-gradient-title {
    background: linear-gradient(90deg, #ffffff 0%, #c7d2fe 45%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-heading);
}

/* Custom Navigation Tabs (Cápsula nav-pills-custom) */
.tab-group-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.35rem;
    display: flex;
    gap: 0.25rem;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.55rem 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 50px;
    transition: all 0.25s ease;
    font-family: var(--font-body);
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.tab-active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
}

/* Dropzone Styling */
.dropzone-box {
    border: 2px dashed rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dropzone-box:hover,
.dropzone-box.dragover {
    border-color: #a855f7;
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.008);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.2);
}

.dropzone-icon-circle {
    width: 5rem;
    height: 5rem;
    border-radius: 22px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(165, 180, 252, 0.25);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.dropzone-box:hover .dropzone-icon-circle {
    transform: scale(1.08);
    background: rgba(168, 85, 247, 0.25);
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.4);
}

/* Form Controls and Inputs (Píldora traslúcida) */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-radius: 50px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    transition: all 0.25s ease !important;
}

.form-control::placeholder {
    color: #64748b !important;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(167, 139, 250, 0.6) !important;
    box-shadow: var(--neon-focus-glow) !important;
    color: #ffffff !important;
    outline: none !important;
}

/* Fix dropdown option colors on dark background */
.form-select option,
.form-select optgroup {
    background-color: #1e293b;
    color: #f1f5f9;
}

/* Custom Range Input */
input[type="range"] {
    accent-color: #a855f7;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Checkbox and Radios */
.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Radio Card Fit Option */
.fit-mode-label {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.6rem 0.8rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.fit-mode-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
}

.fit-mode-label:has(input:checked) {
    background: rgba(99, 102, 241, 0.15);
    border-color: #818cf8;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* Neon Status Indicators & Badges */
.badge-neon-green {
    background: var(--neon-green-bg);
    color: var(--neon-green);
    border: 1px solid rgba(52, 211, 153, 0.3);
    box-shadow: var(--neon-green-glow);
    border-radius: 50px;
    font-weight: 600;
}

.badge-neon-amber {
    background: var(--neon-amber-bg);
    color: var(--neon-amber);
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: var(--neon-amber-glow);
    border-radius: 50px;
    font-weight: 600;
}

.badge-neon-red {
    background: var(--neon-red-bg);
    color: var(--neon-red);
    border: 1px solid rgba(248, 113, 113, 0.3);
    box-shadow: var(--neon-red-glow);
    border-radius: 50px;
    font-weight: 600;
}

.badge-neon-primary {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 50px;
    font-weight: 600;
}

/* Checkerboard for transparent canvas/preview */
.checkerboard-pattern {
    background-color: #1e293b;
    background-image: linear-gradient(45deg, #0f172a 25%, transparent 25%),
        linear-gradient(-45deg, #0f172a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #0f172a 75%),
        linear-gradient(-45deg, transparent 75%, #0f172a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modals Dark Glass */
.modal-glass-backdrop {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-dialog-panel {
    background: rgba(30, 41, 59, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

/* Cropper styling constraints */
#cropTargetImage {
    display: block;
    max-width: 100%;
    max-height: 55vh;
}

.cropper-container {
    max-height: 55vh !important;
}

/* Aspect ratio active pill button */
.crop-ratio-buttons .btn.active-ratio {
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: var(--primary-glow);
}

/* Savings Banner */
.savings-banner {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    box-shadow: 0 10px 35px rgba(99, 102, 241, 0.35);
}

/* Utilities */
.fs-xs {
    font-size: 0.75rem;
}

.fs-2xs {
    font-size: 0.68rem;
}

.cursor-pointer {
    cursor: pointer;
}

.border-subtle {
    border-color: rgba(255, 255, 255, 0.08) !important;
}