/* GST Calculator - Mobile First Responsive Design */
/* Reset and Base Styles */
.gst-calculator-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    background: #ffffff;
    padding: 1rem;
}

/* Title Container */
.gst-title-container {
    background: #2CEC00;
    color: #ffffff;
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gst-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.gst-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

/* Calculator Card */
.gst-calculator-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Input Grid - Mobile (1 column) */
.gst-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Input Group */
.gst-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gst-input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Tooltip */
.gst-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    background: #e5e7eb;
    color: #111827;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    user-select: none;
}

/* Input with Symbol */
.gst-input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}

.gst-input-with-symbol .gst-currency-symbol,
.gst-input-with-symbol .gst-percent-symbol {
    position: absolute;
    padding: 0 0.75rem;
    color: #6b7280;
    font-weight: 500;
    pointer-events: none;
    z-index: 2;
}

.gst-input-with-symbol .gst-currency-symbol {
    left: 0;
}

.gst-input-with-symbol .gst-percent-symbol {
    right: 0;
}

.gst-input-with-symbol .gst-input {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Input and Select Styles */
.gst-input,
.gst-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #111827;
    box-sizing: border-box;
    min-height: 44px; /* Touch-friendly */
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

.gst-select {
    padding-right: 2.5rem;
}

.gst-input:focus,
.gst-select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.gst-input::placeholder {
    color: #9ca3af;
}

/* Country Flag Display */
.gst-country-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Error Message */
.gst-error-message {
    font-size: 0.75rem;
    color: #dc2626;
    min-height: 1rem;
    display: none;
}

.gst-error-message:not(:empty) {
    display: block;
}

/* Advanced Options */
.gst-advanced-toggle {
    margin-bottom: 1.5rem;
}

.gst-advanced-btn {
    width: 100%;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    min-height: 44px;
}

.gst-advanced-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.gst-toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.gst-advanced-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0.5rem;
}

.gst-advanced-section.active {
    max-height: 500px;
}

.gst-advanced-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    background: #ffffff;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

/* Button Group */
.gst-button-group {
    position: relative;
}

.gst-calculate-btn {
    width: 100%;
    padding: 0.875rem;
    background: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    min-height: 44px;
}

.gst-calculate-btn:hover {
    background: #16a34a;
}

.gst-calculate-btn:active {
    transform: translateY(1px);
}

/* Loading Indicator */
.gst-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.gst-loading.active {
    display: flex;
}

.gst-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: gst-spin 1s linear infinite;
}

@keyframes gst-spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.gst-results-section {
    display: none;
    margin-top: 2rem;
    animation: gst-fadeIn 0.5s ease;
}

.gst-results-section.active {
    display: block;
}

@keyframes gst-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Results Cards */
.gst-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gst-result-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gst-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

.gst-result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

.gst-result-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0 0;
}

/* Progress Bar */
.gst-progress-container {
    margin: 2rem 0;
}

.gst-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.gst-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 4px;
    transition: width 1s ease;
}

.gst-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Charts Container */
.gst-charts-container {
    margin: 2rem 0;
}

.gst-chart-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    height: 300px !important;
}

.gst-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Country Info Display in Results */
.gst-country-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.gst-country-flag {
    font-size: 1.5rem;
}

.gst-country-name {
    font-weight: 600;
    color: #111827;
}

.gst-tax-type {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Breakdown Table */
.gst-breakdown-section {
    margin: 2rem 0;
}

.gst-breakdown-table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.gst-breakdown-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.gst-breakdown-table th,
.gst-breakdown-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.gst-breakdown-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
    white-space: nowrap;
}

.gst-breakdown-table td {
    font-size: 0.875rem;
    color: #111827;
}

.gst-breakdown-table tr:last-child td {
    border-bottom: none;
}

/* Annual Summary */
.gst-annual-summary {
    margin: 2rem 0;
}

.gst-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
}

.gst-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gst-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gst-summary-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.gst-summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

/* Action Buttons */
.gst-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
}

.gst-action-btn {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
}

.gst-export-btn {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.gst-export-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.gst-reset-btn {
    background: #ffffff;
    color: #111827;
}

.gst-reset-btn:hover {
    background: #f9fafb;
}

/* Tablet Styles (481px - 768px) */
@media (min-width: 481px) {
    .gst-calculator-wrapper {
        padding: 1.5rem;
    }
    
    .gst-main-title {
        font-size: 2rem;
    }
    
    .gst-subtitle {
        font-size: 1.125rem;
    }
    
    .gst-calculator-card {
        padding: 2rem;
    }
    
    .gst-input-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gst-input-group:first-child {
        grid-column: 1 / -1;
    }
    
    .gst-advanced-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .gst-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gst-charts-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .gst-chart-wrapper {
        height: 250px !important;
        margin-bottom: 0;
    }
    
    .gst-summary-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop Styles (769px and above) */
@media (min-width: 769px) {
    .gst-calculator-wrapper {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    .gst-title-container {
        padding: 2rem;
    }
    
    .gst-main-title {
        font-size: 2.5rem;
    }
    
    .gst-input-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gst-results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gst-action-buttons {
        grid-template-columns: auto auto;
        justify-content: start;
        gap: 1rem;
    }
    
    .gst-action-btn {
        padding: 0.75rem 1.5rem;
        min-width: 140px;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    .gst-calculator-wrapper {
        padding: 0.75rem;
    }
    
    .gst-calculator-card {
        padding: 1.25rem;
    }
    
    .gst-main-title {
        font-size: 1.5rem;
    }
    
    .gst-subtitle {
        font-size: 0.875rem;
    }
    
    .gst-input,
    .gst-select {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .gst-result-value {
        font-size: 1.5rem;
    }
    
    .gst-chart-wrapper {
        height: 250px !important;
        padding: 1rem;
    }
    
    .gst-action-buttons {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .gst-calculator-wrapper {
        padding: 0;
    }
    
    .gst-title-container {
        background: #2CEC00 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .gst-calculator-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .gst-input-section,
    .gst-advanced-toggle,
    .gst-button-group,
    .gst-action-buttons {
        display: none !important;
    }
    
    .gst-results-section {
        display: block !important;
    }
    
    .gst-chart-wrapper canvas {
        height: 200px !important;
    }
}

/* Accessibility */
.gst-input:focus,
.gst-select:focus,
.gst-calculate-btn:focus,
.gst-advanced-btn:focus,
.gst-action-btn:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Screen Reader Only */
.gst-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}