/* ============================================
   StatusHub Age Calculator - Mobile First
   ============================================ */

/* Reset & Base */
.sh-calc-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
}

.sh-calc-wrapper *,
.sh-calc-wrapper *::before,
.sh-calc-wrapper *::after {
    box-sizing: border-box;
}

/* Form Section */
.sh-calc-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sh-form-group {
    margin-bottom: 20px;
}

.sh-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    margin-bottom: 6px;
}

.sh-form-group input[type="date"],
.sh-form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #1a1a2e;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.sh-form-group input[type="date"]:focus,
.sh-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sh-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 8.825L0.575 3.4L1.4 2.575L6 7.175L10.6 2.575L11.425 3.4L6 8.825Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.sh-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Calculate Button */
.sh-calc-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.sh-calc-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.sh-calc-btn:active {
    transform: translateY(0);
}

/* Result Cards */
.sh-result-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sh-result-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

/* Age Display */
.sh-age-display {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
}

.sh-age-unit {
    text-align: center;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 80px;
    flex: 1;
    max-width: 140px;
}

.sh-age-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: #2563eb;
    line-height: 1.1;
}

.sh-age-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.sh-age-as-on {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 12px 0 0 0;
}

/* Info Grid */
.sh-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sh-info-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.sh-info-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.sh-info-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Exam Table */
.sh-exam-note {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
}

.sh-exam-note span {
    font-weight: 700;
    color: #2563eb;
}

.sh-exam-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}

.sh-exam-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 440px;
}

.sh-exam-table thead {
    background: #f1f5f9;
}

.sh-exam-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.sh-exam-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.sh-exam-table tbody tr:hover {
    background: #f8fafc;
}

/* Eligibility Status Badges */
.sh-status-eligible {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
}

.sh-status-not-eligible {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
}

.sh-status-age-low {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
}

.sh-exam-disclaimer {
    font-size: 12px;
    color: #94a3b8;
    margin: 16px 0 0 0;
    font-style: italic;
}

/* Error Message */
.sh-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

/* ============================================
   Desktop Styles (768px+)
   ============================================ */
@media (min-width: 768px) {
    .sh-calc-form {
        padding: 32px;
    }

    .sh-result-card {
        padding: 28px 32px;
    }

    .sh-age-number {
        font-size: 48px;
    }

    .sh-age-unit {
        padding: 20px 28px;
    }

    .sh-info-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .sh-exam-table {
        font-size: 15px;
    }

    .sh-exam-table-wrapper {
        margin: 0;
        padding: 0;
    }
}

/* ============================================
   Small Screen Adjustments (below 400px)
   ============================================ */
@media (max-width: 400px) {
    .sh-calc-form {
        padding: 16px;
    }

    .sh-result-card {
        padding: 16px;
    }

    .sh-age-display {
        gap: 8px;
    }

    .sh-age-number {
        font-size: 28px;
    }

    .sh-age-unit {
        padding: 12px 8px;
        min-width: 60px;
    }
}

/* Print styles */
@media print {
    .sh-calc-form {
        display: none;
    }

    .sh-result-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}
