/**
 * Shared CSS for NWCA Manual and Contract Calculators
 * Provides consistent styling across all pricing calculators
 * 
 * Color Theme: NWCA Green (#4cb354)
 * Font: Inter
 * Layout: Clean, functional, card-based design
 */

/* Root variables - Consistent Green Theme */
:root {
    --primary-color: #4cb354;
    --primary-dark: #2d5f3f;
    --primary-light: #4cb861;
    --primary-lighter: #e8f5e9;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --hover-bg: #f3f4f6;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --error-bg: #fee;
    --error-text: #c53030;
    --focus-shadow: 0 0 0 0.25rem rgba(76, 179, 84, 0.25);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Header Styles */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 40px;
    width: auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Page Title Section */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Card Components */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Grid Layouts */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:hover {
    border-color: #d1d5db;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-shadow);
}

/* Select Elements */
select.form-control {
    cursor: pointer;
    /* Use browser's default dropdown arrow */
    /* Removed custom arrow to prevent double arrows */
}

/* Number Inputs */
input[type="number"].form-control {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #fed7aa;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #86efac;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}

.alert-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

/* Pricing Display Components */
.pricing-section {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.price-row:last-child {
    border-bottom: none;
}

.price-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.price-value {
    font-weight: 600;
    color: var(--text-primary);
}

.price-total {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Results Section */
.results-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header .price-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.results-header .price-display.prompt {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Price Display for Sliders */
.slider-header .price-display {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.full-width {
    grid-column: 1 / -1;
}

/* Interactive Slider Styles */
.slider-container {
    margin: 20px 0;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stitch-display {
    font-weight: 600;
    color: var(--primary-color);
}

.price-display.neutral {
    background: #e8f5e9;
    color: #2e7d32;
}

.price-display.positive {
    background: #ffebee;
    color: #c62828;
}

.price-display.negative {
    background: #e8f5e9;
    color: #2e7d32;
}

.slider-wrapper {
    position: relative;
    margin: 10px 0;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e0e0e0 0%, #e0e0e0 100%);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.slider-tooltip {
    position: absolute;
    top: -50px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
}

.slider-tooltip.dual-line {
    text-align: center;
    line-height: 1.3;
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
}

.slider-range-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.stitch-slider-container {
    margin-top: 10px;
}

.stitch-slider-container label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.stitch-range {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Logo Options for Additional Embroidery */
.logo-option {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
}

.logo-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.logo-checkbox label {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.logo-stitch-control {
    margin-top: 15px;
    padding-left: 28px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0 1rem;
    }
    
    .main-container {
        padding: 0 1rem;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .price-display {
        font-size: 2.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .slider-container {
        margin: 15px 0;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header {
        position: static;
        box-shadow: none;
    }
    
    .card {
        box-shadow: none;
        break-inside: avoid;
    }
    
    .btn,
    .no-print {
        display: none !important;
    }
}