/**
 * Stress Index Calculator Frontend Styles
 * Color Scheme:
 * Primary: #ff284B (Red) - CTAs, important icons
 * Secondary: #0065A2 (Blue) - Buttons, Links, Section Dividers
 * Accent: #FAFAFA (Off-White) - Backgrounds or cards
 * Text: #222222 (Charcoal) - most text
 * Text 2: #4a4a4a (Slate gray) - subheadings
 */

.sic-calculator-wrapper,
.sic-tracker-wrapper {
    max-width: 1000px;
    margin: 30px auto;
    padding: 40px 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.sic-header,
.sic-tracker-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid #0065A2;
    position: relative;
}

.sic-back-button {
    position: absolute;
    left: 0;
    top: 0;
    background: transparent;
    border: 2px solid #0065A2;
    color: #0065A2;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}

.sic-back-button:hover {
    background: #0065A2;
    color: #fff;
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(0, 101, 162, 0.2);
}

.sic-header h1,
.sic-tracker-header h1 {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #222222;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sic-header h2,
.sic-tracker-header h2 {
    font-size: 24px;
    margin: 10px 0;
    color: #0065A2;
    font-weight: 600;
}

.sic-subtitle {
    font-size: 16px;
    color: #4a4a4a;
    font-style: italic;
    margin-top: 15px;
    font-weight: 400;
}

.sic-instructions {
    background: #FAFAFA;
    padding: 25px 30px;
    border-radius: 8px;
    margin-bottom: 35px;
    border-left: 4px solid #0065A2;
}

.sic-instructions p {
    margin: 12px 0;
    color: #222222;
    line-height: 1.6;
}

.sic-instructions p strong {
    color: #0065A2;
    font-weight: 600;
}

.sic-scale-reference {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.sic-scale-reference li {
    padding: 10px 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.sic-scale-reference li strong {
    color: #0065A2;
    font-weight: 700;
    margin-right: 8px;
}

.sic-form,
.sic-tracker-form {
    background: #fff;
    padding: 0;
}

.sic-section {
    margin-bottom: 45px;
    padding-bottom: 35px;
    border-bottom: 2px solid #FAFAFA;
}

.sic-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sic-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0065A2;
    display: inline-block;
    width: 100%;
}

.sic-section-subtitle {
    font-size: 15px;
    color: #4a4a4a;
    margin-bottom: 20px;
    font-style: italic;
    font-weight: 400;
}

.sic-reverse-notice {
    font-size: 13px;
    color: #4a4a4a;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.sic-question {
    margin-bottom: 25px;
    padding: 20px;
    background: #FAFAFA;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.sic-question:hover {
    border-color: #0065A2;
    box-shadow: 0 2px 8px rgba(0, 101, 162, 0.1);
}

.sic-question-label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #222222;
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.sic-scale-options-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sic-scale-option-simple {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.sic-scale-option-simple:hover {
    border-color: #0065A2;
    background: #f0f7fb;
}

.sic-scale-option-simple input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.sic-custom-radio {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    transition: all 0.2s ease;
    background: #fff;
}

.sic-scale-option-simple:hover .sic-custom-radio {
    border-color: #0065A2;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-custom-radio {
    border-color: #0065A2;
    background: #0065A2;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-custom-radio:after {
    content: "";
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.sic-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.sic-scale-number {
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    min-width: 20px;
    text-align: center;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-option-content .sic-scale-number {
    color: #ff284B;
}

.sic-scale-text {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.4;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-option-content .sic-scale-text {
    color: #222222;
    font-weight: 600;
}

.sic-scale-option-simple:has(input[type="radio"]:checked) {
    background: #f0f7fb;
    border-color: #0065A2;
    box-shadow: 0 2px 4px rgba(0, 101, 162, 0.1);
}

/* Fallback for browsers without :has() support */
.sic-scale-option-simple input[type="radio"]:checked {
    z-index: 1;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-custom-radio {
    border-color: #0065A2;
    background: #0065A2;
}

.sic-scale-option-simple input[type="radio"]:checked ~ .sic-custom-radio:after {
    content: "";
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.sic-form-actions {
    margin-top: 40px;
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid #FAFAFA;
}

.sic-button {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sic-button-primary {
    background: #ff284B;
    color: #fff;
}

.sic-button-primary:hover {
    background: #e01e3d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 40, 75, 0.3);
}

.sic-button-secondary {
    background: #0065A2;
    color: #fff;
}

.sic-button-secondary:hover {
    background: #005288;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 101, 162, 0.3);
}

.sic-results {
    margin-top: 40px;
    padding: 40px;
    background: linear-gradient(135deg, #FAFAFA 0%, #ffffff 100%);
    border-radius: 12px;
    text-align: center;
    border: 2px solid #0065A2;
}

.sic-score-display {
    margin-bottom: 35px;
}

.sic-score-display h3 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #222222;
    font-weight: 700;
}

.sic-score-value {
    font-size: 80px;
    font-weight: 700;
    color: #ff284B;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.sic-score-max {
    font-size: 32px;
    color: #4a4a4a;
    margin-bottom: 25px;
    font-weight: 600;
}

.sic-score-interpretation {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sic-score-description {
    font-size: 18px;
    color: #4a4a4a;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.sic-next-steps {
    text-align: left;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid #0065A2;
}

.sic-next-steps h4 {
    margin-top: 0;
    color: #222222;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.sic-next-steps ul {
    margin: 15px 0;
    padding-left: 25px;
    list-style: none;
}

.sic-next-steps li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    color: #4a4a4a;
    line-height: 1.7;
}

.sic-next-steps li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0065A2;
    font-weight: 700;
    font-size: 18px;
}

/* Progress Tracker Styles */
.sic-user-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
    padding: 25px;
    background: #FAFAFA;
    border-radius: 8px;
}

.sic-field {
    margin-bottom: 25px;
}

.sic-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222222;
    font-size: 15px;
}

.sic-field input[type="text"],
.sic-field input[type="email"],
.sic-field input[type="date"],
.sic-field input[type="number"],
.sic-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    color: #222222;
    font-family: inherit;
}

.sic-field input[type="text"]:focus,
.sic-field input[type="email"]:focus,
.sic-field input[type="date"]:focus,
.sic-field input[type="number"]:focus,
.sic-field textarea:focus {
    outline: none;
    border-color: #0065A2;
    box-shadow: 0 0 0 3px rgba(0, 101, 162, 0.1);
}

.sic-field textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.sic-symptoms-section {
    margin: 25px 0;
    padding: 25px;
    background: #FAFAFA;
    border-radius: 8px;
}

.sic-symptoms-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #222222;
    font-size: 16px;
}

.sic-symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.sic-checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.sic-checkbox-label:hover {
    border-color: #0065A2;
    background: #f0f7fb;
}

.sic-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #0065A2;
}

.sic-checkbox-label input[type="checkbox"]:checked ~ *,
.sic-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #0065A2;
    background: #f0f7fb;
}

/* Fallback for browsers without :has() support */
.sic-checkbox-label input[type="checkbox"]:checked {
    border-color: #0065A2;
}

.sic-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #0065A2;
    background: #f0f7fb;
}

.sic-sessions-table,
.sic-before-after-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sic-sessions-table th,
.sic-before-after-table th {
    background: #0065A2;
    color: #fff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
}

.sic-sessions-table td,
.sic-before-after-table td {
    padding: 15px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.sic-sessions-table tr:nth-child(even) td,
.sic-before-after-table tr:nth-child(even) td {
    background: #FAFAFA;
}

.sic-sessions-table tr:last-child td,
.sic-before-after-table tr:last-child td {
    border-bottom: none;
}

.sic-score-input,
.sic-changes-input,
.sic-small-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.sic-score-input:focus,
.sic-changes-input:focus,
.sic-small-input:focus {
    outline: none;
    border-color: #0065A2;
    box-shadow: 0 0 0 3px rgba(0, 101, 162, 0.1);
}

.sic-before-after-table label {
    display: inline-block;
    margin-right: 15px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sic-before-after-table label:hover {
    background: #FAFAFA;
}

.sic-before-after-table input[type="radio"] {
    margin-right: 6px;
    accent-color: #0065A2;
}

.sic-before-after-table input[type="radio"]:checked + label {
    background: #f0f7fb;
    color: #0065A2;
    font-weight: 600;
}

/* Modern browser support */
.sic-before-after-table label:has(input[type="radio"]:checked) {
    background: #f0f7fb;
    color: #0065A2;
    font-weight: 600;
}

.sic-recommendations {
    margin-top: 20px;
    padding: 25px;
    background: #FAFAFA;
    border-radius: 8px;
}

.sic-recommendations label {
    display: block;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sic-recommendations label:hover {
    border-color: #0065A2;
    background: #f0f7fb;
}

.sic-recommendations input[type="radio"] {
    margin-right: 10px;
    accent-color: #0065A2;
}

.sic-recommendations input[type="radio"]:checked + span,
.sic-recommendations label:has(input[type="radio"]:checked) {
    border-color: #0065A2;
    background: #f0f7fb;
    color: #0065A2;
    font-weight: 600;
}

.sic-message {
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 8px;
    font-weight: 600;
    border-left: 4px solid;
}

.sic-message-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.sic-message-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* Smooth transitions for show/hide */
.sic-calculator-wrapper,
.sic-tracker-wrapper {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .sic-calculator-wrapper,
    .sic-tracker-wrapper {
        padding: 25px 20px;
        margin: 20px 15px;
    }
    
    .sic-header h1,
    .sic-tracker-header h1 {
        font-size: 26px;
    }
    
    .sic-header h2,
    .sic-tracker-header h2 {
        font-size: 20px;
    }
    
    .sic-scale-options-columns {
        grid-template-columns: 1fr;
    }
    
    .sic-scale-option-simple {
        padding: 10px 12px;
    }
    
    .sic-user-info {
        grid-template-columns: 1fr;
    }
    
    .sic-symptoms-grid {
        grid-template-columns: 1fr;
    }
    
    .sic-score-value {
        font-size: 60px;
    }
    
    .sic-button {
        width: 100%;
        margin: 8px 0;
    }
    
    .sic-sessions-table,
    .sic-before-after-table {
        font-size: 13px;
    }
    
    .sic-sessions-table th,
    .sic-before-after-table th,
    .sic-sessions-table td,
    .sic-before-after-table td {
        padding: 10px 8px;
    }
}
