/**
 * Calculator Styles - Sjukpenning.se
 * Elegant beige theme with excellent mobile support
 */

/* ==================== CALCULATOR CONTAINER ==================== */
.calculator-container {
    margin-bottom: var(--space-3xl);
}

.calculator-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-2xl);
}

.calculator-intro h2 {
    color: var(--primary-dark);
    margin-bottom: var(--space-md);
}

.calculator-intro p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==================== CALCULATOR BOX ==================== */
.calculator {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--accent-cream) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent-sand-light);
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
}

.calculator-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--accent-sand);
}

.calculator-header h3 {
    color: var(--primary-dark);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-bottom: var(--space-sm);
}

.calculator-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==================== FORM STYLES ==================== */
.calculator-form {
    margin-bottom: 0;
}

.form-section {
    background: var(--bg-primary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--accent-sand-light);
}

.form-section:last-of-type {
    margin-bottom: var(--space-xl);
}

.form-section-title {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--accent-sand);
    border-radius: 2px;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
}

.required {
    color: var(--error);
    font-weight: 700;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--accent-sand-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.input-wrapper input {
    padding-right: 70px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-taupe);
    box-shadow: 0 0 0 3px rgba(168, 159, 145, 0.1);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

.form-group small {
    display: block;
    margin-top: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 2px solid var(--accent-sand-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.radio-option:hover {
    border-color: var(--accent-sand);
    background: var(--bg-light);
}

.radio-option input[type="radio"] {
    width: auto;
    margin-right: var(--space-sm);
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + label {
    font-weight: 600;
    color: var(--primary-dark);
}

/* ==================== CALCULATOR ACTIONS ==================== */
.calculator-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

.calculator-actions .btn {
    min-width: 180px;
}

.btn-reset {
    background: var(--bg-primary);
    border: 2px solid var(--accent-sand);
    color: var(--text-primary);
}

.btn-reset:hover {
    background: var(--accent-sand-light);
    border-color: var(--accent-taupe);
}

/* ==================== CALCULATOR RESULT ==================== */
.calculator-result {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    border: 2px solid var(--success);
    box-shadow: var(--shadow-md);
    animation: slideIn var(--transition-slow);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--accent-sand-light);
}

.result-header h3 {
    color: var(--primary-dark);
    margin-bottom: 0;
}

.result-status {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.result-item {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--accent-sand-light);
    transition: all var(--transition-base);
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-sand);
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--accent-cream) 0%, var(--accent-sand-light) 100%);
    border-color: var(--accent-taupe);
}

.result-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.result-value {
    display: block;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: var(--space-sm);
    font-family: var(--font-heading);
}

.result-subtext {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-breakdown {
    background: var(--bg-light);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.result-breakdown h4 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--accent-sand-light);
}

.breakdown-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.breakdown-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.breakdown-value {
    font-weight: 600;
    color: var(--primary-dark);
}

.result-note {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.6;
}

.result-note.info {
    background: var(--info-light);
    border-left-color: var(--info);
}

.result-note.warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
}

.result-note strong {
    color: var(--primary-dark);
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 767px) {
    .calculator {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }
    
    .calculator-header {
        padding-bottom: var(--space-md);
    }
    
    .form-section {
        padding: var(--space-md);
    }
    
    .calculator-actions {
        flex-direction: column;
    }
    
    .calculator-actions .btn {
        width: 100%;
        min-width: 0;
    }
    
    .calculator-result {
        padding: var(--space-lg);
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .result-breakdown {
        padding: var(--space-md);
    }
    
    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
}

@media (max-width: 480px) {
    .calculator {
        padding: var(--space-md);
    }
    
    .form-section {
        padding: var(--space-sm) var(--space-md);
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ==================== LOADING STATE ==================== */
.calculator.loading {
    opacity: 0.6;
    pointer-events: none;
}

.calculator.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-sand);
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .calculator-actions,
    .calculator-header p {
        display: none;
    }
    
    .calculator {
        border: 2px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .calculator-result {
        border: 1px solid #000;
        box-shadow: none;
    }
}
