/* ==========================================================================
   Premium Design Token System (Shopify Premium Theme Palette)
   ========================================================================== */
:root {
    --bg-dark: #070709;
    --bg-surface: #0f0f15;
    --bg-surface-glow: #161622;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Harmonious HSL Tailored Colors */
    --accent: hsl(164, 100%, 35%);        /* Shopify Green */
    --accent-glow: hsla(164, 100%, 35%, 0.15);
    --accent-highlight: hsl(190, 100%, 45%); /* Neon Teal */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Utility States */
    --success: hsl(142, 70%, 45%);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(350, 89%, 60%);
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Shadow & Glows */
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    --glow-primary: 0 0 30px rgba(0, 128, 96, 0.25);
    --glow-teal: 0 0 35px rgba(0, 229, 255, 0.2);
}

/* ==========================================================================
   Global Reset & Ambient Background
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Premium Ambient Glowing Blobs */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
    transition: all 1.5s ease-in-out;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, hsla(164, 100%, 35%, 0.2) 0%, transparent 70%);
    top: -150px;
    left: -100px;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, hsla(270, 95%, 45%, 0.15) 0%, transparent 70%);
    bottom: 10%;
    right: -150px;
}

.glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, hsla(190, 100%, 45%, 0.12) 0%, transparent 70%);
    top: 30%;
    left: 45%;
}

/* ==========================================================================
   Layout Wrapper
   ========================================================================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1560px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(15, 15, 21, 0.65);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
}

.brand-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.accent-text {
    color: var(--accent);
}

.badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent-highlight));
    color: #fff;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 8px;
}

.badge-accent {
    background: linear-gradient(135deg, #a855f7, #6366f1);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
    color: var(--text-primary);
    background: rgba(0, 128, 96, 0.08);
    border-color: rgba(0, 128, 96, 0.2);
}

.header-actions .tier-indicator {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions .tier-indicator i {
    color: var(--accent);
}

/* ==========================================================================
   Main Dashboard Layout Grid
   ========================================================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 24px;
    flex-grow: 1;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Panels (Glassmorphism design)
   ========================================================================== */
.panel {
    background: rgba(15, 15, 21, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.panel-title i {
    font-size: 1.35rem;
    color: var(--accent-highlight);
}

.panel-title h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
}

.panel-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-hint {
    font-size: 0.82rem;
    color: var(--accent-highlight);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.action-hint:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-highlight);
}

/* Preset Picker Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.preset-btn i {
    font-size: 1.15rem;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.preset-btn.active {
    background: rgba(0, 128, 96, 0.06);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(0, 128, 96, 0.1);
}

/* Custom Editor Area */
.code-editor-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.editor-gutter {
    padding: 16px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: right;
    display: flex;
    flex-direction: column;
    user-select: none;
    min-width: 32px;
}

#code-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    padding: 16px;
    resize: none;
    height: 180px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Slider Controls */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.slider-value {
    color: var(--text-primary);
    font-weight: 600;
}

.slider-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    outline: none;
    transition: background 0.3s;
}

.slider-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s;
}

.slider-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-bar.accent-bar::-webkit-slider-thumb {
    background: var(--accent-highlight);
    box-shadow: 0 0 10px var(--accent-highlight);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    padding: 14px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #009e74);
    color: #fff;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(0, 128, 96, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 8px;
}

.btn-full-width {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Output Panel & Widgets
   ========================================================================== */
.output-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* Audit Score Layout */
.audit-results-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .audit-results-grid {
        grid-template-columns: 1fr;
    }
}

.score-card {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.score-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.score-circle-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.score-ring {
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 8;
}

.ring-fg {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke: var(--warning);
    stroke-dasharray: 314.16;
    stroke-dashoffset: 75;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s;
}

.score-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
}

.score-num {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.score-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    max-width: 200px;
    margin: 0 auto;
}

/* Metric Row Metrics */
.metrics-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metric-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m-label {
    width: 130px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-label i {
    width: 16px;
    color: var(--text-muted);
}

.m-progress-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 99px;
    overflow: hidden;
}

.m-progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-danger { background-color: var(--danger); }

.m-value {
    width: 70px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Section Card Header with Badge */
.section-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-header-with-badge,
.card-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-card h3 i {
    color: var(--accent-highlight);
}

.card-intro {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ROI sliders and result strips */
.roi-sliders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .roi-sliders-grid {
        grid-template-columns: 1fr;
    }
}

.roi-results-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 500px) {
    .roi-results-strip {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.roi-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roi-statHighlight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(0, 128, 96, 0.05));
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin: -8px 0;
}

.roi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.roi-number {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
}

.text-success { color: var(--success); }
.text-highlight { 
    color: var(--accent-highlight);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Animated Pulse Effect */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.animate-pulse {
    animation: pulse 2.5s infinite ease-in-out;
}

/* Code Output Box */
.code-output-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    max-height: 180px;
}

.code-output-wrapper pre {
    margin: 0;
}

.code-output-wrapper code {
    color: #cbd5e1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(15, 15, 21, 0.4);
    border-top: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot-active {
    color: var(--success);
    margin-right: 6px;
    animation: pulse 1.5s infinite;
}

.divider {
    margin: 0 12px;
    color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Notification Toast
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(15, 15, 21, 0.95);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-premium), var(--glow-primary);
    z-index: 9999;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}
