/**
 * Studio 6ix Service Calculator - Compact Styles
 * Mobile-First, High Density Layout
 */

:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #0891b2;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Service Tier Colors */
    --tier-volume: #8b5cf6;
    --tier-standard: #0891b2;
    --tier-premium: #dc2626;
    
    /* Spacing - Compact */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    
    /* Layout */
    --container-max-width: 1400px;
    --border-radius: 6px;
    --border-radius-lg: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    
    /* Typography */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px; /* Smaller base font size for compactness */
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.4;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

/* Layout Components */
.calculator-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-sm);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
}

.calculator-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

.calculator-header .subtitle {
    font-size: 0.75rem;
    color: var(--gray-600);
    display: none; /* Hide subtitle on mobile to save space */
}

@media (min-width: 640px) {
    .calculator-header .subtitle {
        display: block;
    }
}

.calculator-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    align-content: start;
}

/* Desktop Layout: 3 Columns */
@media (min-width: 1024px) {
    .calculator-main {
        grid-template-columns: 250px 1fr 300px; /* Fixed sidebars, fluid center */
        align-items: start;
    }
}

/* Shoot Type Selector */
.shoot-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 12px;
    max-width: 100%;
    overflow: hidden;
}

.shoot-type-option {
    flex: 1;
    min-width: 0; /* Allow flex items to shrink below content size */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.shoot-type-option:hover {
    border-color: #e0e0e0;
    transform: translateY(-1px);
}

.shoot-type-option.active {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.type-icon {
    font-size: 2rem;
}

.type-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.type-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-desc {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.2;
    word-wrap: break-word;
}

/* Disabled State for Groups */
.parameter-group.disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(100%);
}

.parameter-group.disabled input {
    background: #eee;
}

/* Section Styling */
section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--gray-100);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input Groups (Location) */
.input-group {
    margin-bottom: var(--spacing-sm);
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 2px;
    font-size: 0.75rem;
}

.input-group input[type="text"],
.input-group input[type="number"] {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.15s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Parameter Groups (Shoot Details) */
.parameter-group {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-100);
    max-width: 100%;
    overflow: hidden;
}

.parameter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.parameter-group label {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.85rem;
    margin: 0;
}

.help-text {
    font-size: 0.7rem;
    color: var(--gray-500);
    display: block;
    margin-top: 2px;
}

/* Input Controls (Stepper) */
.input-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.stepper-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--border-radius);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slider Styling - Compact */
.slider-container {
    position: relative;
    margin: 0.5rem 0;
    max-width: 100%;
    overflow: hidden;
    padding-top: 1rem; /* Add space for the slider thumb so it doesn't overlap */
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* Increase margin to separate controls from slider */
    font-size: 0.7rem;
    color: var(--gray-500);
}

.slider-label-current {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--gray-50);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--primary-color);
}

.slider-label-input {
    font-size: 1rem; /* Larger font for readability */
    font-weight: 700;
    color: var(--primary-color);
    background: var(--gray-50);
    padding: 0 6px;
    border-radius: 8px; /* Match buttons */
    border: 1px solid #d1d5db; /* Match buttons */
    text-align: center;
    width: 5rem; /* Slightly wider */
    height: 48px; /* Match button height */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-label-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.slider-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Spinner Buttons for Mobile */
.spinner-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-btn {
    width: 48px; /* Large touch target */
    height: 48px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    transition: all 0.1s;
    padding: 0;
    line-height: 1;
}

.spinner-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: var(--primary-color);
}

.spinner-btn:active {
    background: #e5e7eb;
    transform: translateY(1px);
}

/* Hide native spinners */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
    height: 4px; /* Thinner track */
    border-radius: 2px;
    background: var(--gray-200);
    outline: none;
    position: relative;
    z-index: 2;
    cursor: pointer;
    margin: 0;
    box-sizing: border-box;
}

.slider-track-fill {
    display: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; /* Smaller thumb */
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-top: -6px; /* Center on track */
}

/* Duration Controls */
.duration-status {
    display: flex;
    align-items: center;
}

.lock-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Duration Breakdown - Compact */
.duration-breakdown {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Side by side on mobile */
    gap: 0.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
}

.breakdown-item.total-row {
    grid-column: 1 / -1;
    border-top: 1px solid var(--gray-200);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

/* Results Section - Compact */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.result-card {
    background: var(--gray-50);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.result-card:nth-child(2) {
    background: #f0f9ff; /* Highlight price */
    border-color: #bae6fd;
}

.result-card h3 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.result-detail {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Price Breakdown */
.price-breakdown {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Footer */
.calculator-footer {
    text-align: center;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-200);
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* Alerts */
.alert-container {
    position: fixed;
    bottom: 1rem; /* Move to bottom for mobile */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
}

.alert {
    background: var(--gray-900);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Embedded Mode */
body.is-embedded {
    background-color: transparent;
    padding: 0;
    margin: 0;
    overflow: hidden; /* Prevent scrollbars on body */
}

body.is-embedded .calculator-container {
    min-height: auto;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
}

body.is-embedded .calculator-header {
    display: none;
}

body.is-embedded .calculator-footer {
    display: none;
}

body.is-embedded section {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: var(--spacing-sm);
    width: 100%;
}

/* Adjust layout for embedded mode */
body.is-embedded .calculator-main {
    gap: var(--spacing-sm);
    width: 100%;
}

/* Ensure content fits */
body.is-embedded .shoot-type-selector {
    margin-bottom: 1rem;
    width: 100%;
}
