/* ============================================
   GST Calculator - Brutalist Styling
   Ray2Volt Solar Toolbox
   ============================================ */

/* Google Sans Flex for UI elements */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@400;500;600;700&display=swap');

/* --- Page Header --- */
.gst-page-header {
    margin-bottom: 1.5rem;
}

.gst-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.gst-page-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* --- Calculator Main Card --- */
.gst-calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 2px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.gst-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

/* --- Input Section --- */
.gst-inputs-section {
    display: flex;
    flex-direction: column;
}

.gst-input-group {
    margin-bottom: 1.5rem;
}

.gst-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* --- Number Input --- */
.gst-input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    border: 1px solid var(--border-medium);
    border-radius: 2px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.1s ease;
    box-sizing: border-box;
}

.gst-input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: #fff;
}

/* --- GST Rate Buttons --- */
.gst-rate-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.gst-rate-btn {
    flex: 1;
    min-width: 60px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    border: 1px solid var(--border-medium);
    border-radius: 2px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.1s ease;
}

.gst-rate-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.gst-rate-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* --- Control Groups --- */
.gst-control-group {
    margin-bottom: 1.5rem;
}

.gst-control-group strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* --- Toggle Buttons --- */
.gst-toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.gst-toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    border: 1px solid var(--border-medium);
    border-radius: 2px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.1s ease;
}

.gst-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.gst-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* --- Results Section --- */
.gst-results-section {
    display: flex;
    flex-direction: column;
}

/* --- Results Table --- */
.gst-table-wrapper {
    border: 1px solid var(--border-medium);
    border-radius: 2px;
    overflow: hidden;
}

.gst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.gst-table thead {
    background: var(--primary);
}

.gst-table th {
    color: #fff;
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-align: left;
}

.gst-table th:last-child {
    text-align: right;
}

.gst-table td {
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.gst-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
}

.gst-table tbody tr:nth-child(even) {
    background: var(--bg-body);
}

.gst-table tbody tr:hover {
    background: var(--bg-hover);
}

/* --- Total Row --- */
.gst-table-total {
    background: var(--primary) !important;
}

.gst-table-total td {
    color: #fff !important;
    font-weight: 600;
    border-bottom: none;
}

.gst-table-total td:last-child {
    color: #fff !important;
    font-size: 1.1rem;
}

/* --- Responsive Design --- */

/* Tablet */
@media screen and (max-width: 1024px) {
    .gst-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .gst-page-header {
        margin-bottom: 1rem;
    }

    .gst-page-header h1 {
        font-size: 1.5rem;
    }

    .gst-page-header p {
        font-size: 0.875rem;
    }

    .gst-calculator-card {
        padding: 1rem;
    }

    .section-title {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .gst-input-group {
        margin-bottom: 1.25rem;
    }

    .gst-input-group label {
        font-size: 0.8rem;
    }

    .gst-input-field {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        /* Prevent zoom on iOS */
    }

    .gst-rate-selector {
        flex-wrap: wrap;
    }

    .gst-rate-btn {
        min-width: calc(25% - 0.375rem);
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .gst-control-group strong {
        font-size: 0.8rem;
    }

    .gst-toggle-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .gst-toggle-btn {
        padding: 0.75rem 1rem;
    }

    /* Table Responsive */
    .gst-table {
        font-size: 0.8rem;
    }

    .gst-table th,
    .gst-table td {
        padding: 0.75rem 0.75rem;
    }

    .gst-table-total td:last-child {
        font-size: 1rem;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .gst-rate-btn {
        min-width: calc(50% - 0.25rem);
    }

    .gst-toggle-buttons {
        flex-direction: column;
    }

    .gst-table th,
    .gst-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.75rem;
    }

    .gst-table-total td:last-child {
        font-size: 0.9rem;
    }
}