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

.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;
}

/* Tabs */
.sh-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sh-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 0;
}

.sh-tab:hover {
    color: #334155;
}

.sh-tab-active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sh-tab-content {
    display: none;
}

.sh-tab-content-active {
    display: block;
}

/* Form */
.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="number"],
.sh-form-group input[type="text"],
.sh-form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    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: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;
}

/* Buttons */
.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;
}

.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);
}

.sh-add-subject-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    border: 2px dashed #93c5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sh-add-subject-btn:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Big Result Display */
.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;
}

.sh-highlight-card {
    border-color: #3b82f6;
    border-width: 2px;
}

.sh-big-result {
    text-align: center;
    padding: 20px 0;
}

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

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

.sh-result-details {
    text-align: center;
}

.sh-result-details p {
    font-size: 14px;
    color: #475569;
    margin: 6px 0;
}

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

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

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

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

.sh-compare-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-compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

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

/* Grade Reference Table Colors */
.sh-cls-excellent { color: #166534; font-weight: 700; }
.sh-cls-first { color: #1d4ed8; font-weight: 600; }
.sh-cls-second { color: #92400e; font-weight: 600; }
.sh-cls-pass { color: #64748b; font-weight: 600; }
.sh-cls-fail { color: #991b1b; font-weight: 700; }

.sh-grade-ref {
    margin-top: 32px;
}

/* Subject-wise Calculator */
.sh-subject-intro {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
}

.sh-subject-row {
    display: grid;
    grid-template-columns: 1fr 80px 70px 36px;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.sh-subject-row input {
    padding: 10px;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1a1a2e;
    width: 100%;
}

.sh-subject-row input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}

.sh-remove-subject {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
}

.sh-remove-subject:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Desktop */
@media (min-width: 768px) {
    .sh-tab {
        font-size: 14px;
        padding: 12px 16px;
    }

    .sh-calc-form {
        padding: 32px;
    }

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

    .sh-big-number {
        font-size: 64px;
    }

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

/* Small screens */
@media (max-width: 480px) {
    .sh-tab {
        font-size: 11px;
        padding: 8px 6px;
    }

    .sh-calc-form {
        padding: 16px;
    }

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

    .sh-big-number {
        font-size: 44px;
    }

    .sh-subject-row {
        grid-template-columns: 1fr 60px 55px 32px;
        gap: 4px;
    }

    .sh-subject-row input {
        padding: 8px 6px;
        font-size: 13px;
    }
}

/* Print */
@media print {
    .sh-calc-form,
    .sh-tabs,
    .sh-add-subject-btn {
        display: none;
    }

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