/* 
 * GST Calculator Pro - Stylesheet
 * File: assets/css/gst-calculator.css
 * Version: 1.0.0
 */

:root {
    --gst-primary: #51B105;
    --gst-primary-dark: #52AF05;
    --gst-success: #51B105;
    --gst-danger: #ef4444;
    --gst-gray-50: #f9fafb;
    --gst-gray-100: #f3f4f6;
    --gst-gray-200: #e5e7eb;
    --gst-gray-300: #d1d5db;
    --gst-gray-600: #4b5563;
    --gst-gray-700: #374151;
    --gst-gray-900: #111827;
    --gst-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --gst-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gst-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Main Container */
.gst-calculator-pro {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.gst-calc-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--gst-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gst-gray-200);
}

/* Header Section */
.gst-calc-header {
    background: linear-gradient(135deg, var(--gst-primary) 0%, var(--gst-primary-dark) 100%);
    color: white;
    padding: 32px;
    text-align: center;
}

.gst-calc-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gst-calc-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
}

/* Form Section */
.gst-calc-form {
    padding: 32px;
}

.gst-form-group {
    margin-bottom: 24px;
}

.gst-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gst-gray-700);
    font-size: 14px;
}

.gst-form-group input[type="number"],
.gst-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gst-gray-200);
    border-radius: 8px;
    font-size: 16px;
    color: var(--gst-gray-900);
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.gst-form-group input[type="number"]:focus,
.gst-form-group select:focus {
    outline: none;
    border-color: var(--gst-primary);
    box-shadow: 0 0 0 3px rgba(81, 177, 5, 0.1);
}

.gst-form-group input[type="number"]:hover,
.gst-form-group select:hover {
    border-color: var(--gst-gray-300);
}

/* Calculate Button */
.gst-calc-btn {
    width: 100%;
    padding: 16px;
    background: var(--gst-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--gst-shadow-md);
}

.gst-calc-btn:hover {
    background: var(--gst-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--gst-shadow-lg);
}

.gst-calc-btn:active {
    transform: translateY(0);
}

.gst-calc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loader Animation */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.gst-results {
    padding: 32px;
    background: var(--gst-gray-50);
    border-top: 2px solid var(--gst-gray-200);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gst-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.gst-results-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--gst-gray-900);
    font-weight: 700;
}

/* Download Button */
.gst-download-btn {
    padding: 10px 20px;
    background: var(--gst-success);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gst-download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Breakdown Section */
.gst-breakdown {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--gst-shadow);
}

.gst-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--gst-gray-200);
}

.gst-breakdown-item:last-child {
    border-bottom: none;
}

.gst-breakdown-item .label {
    font-size: 15px;
    color: var(--gst-gray-600);
    font-weight: 500;
}

.gst-breakdown-item .value {
    font-size: 16px;
    color: var(--gst-gray-900);
    font-weight: 600;
}

/* Tax Items with Bullets */
.gst-breakdown-item.gst-tax-item .label {
    padding-left: 16px;
    position: relative;
}

.gst-breakdown-item.gst-tax-item .label::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--gst-primary);
    font-weight: bold;
}

/* Total Row */
.gst-breakdown-item.gst-total {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 2px solid var(--gst-gray-300);
}

.gst-breakdown-item.gst-total .label,
.gst-breakdown-item.gst-total .value {
    font-size: 17px;
    font-weight: 700;
    color: var(--gst-gray-900);
}

/* Grand Total Row */
.gst-breakdown-item.gst-grand-total {
    background: linear-gradient(135deg, rgba(81, 177, 5, 0.1) 0%, rgba(82, 175, 5, 0.1) 100%);
    margin: 16px -24px -24px -24px;
    padding: 20px 24px;
    border-radius: 0 0 12px 12px;
}

.gst-breakdown-item.gst-grand-total .label,
.gst-breakdown-item.gst-grand-total .value {
    font-size: 20px;
    font-weight: 800;
    color: var(--gst-primary);
}

/* Invoice Summary */
.gst-invoice-summary {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--gst-shadow);
    border: 2px dashed var(--gst-gray-300);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gst-gray-200);
    flex-wrap: wrap;
    gap: 12px;
}

.invoice-header h4 {
    margin: 0;
    font-size: 18px;
    color: var(--gst-gray-900);
    font-weight: 700;
}

.invoice-date {
    font-size: 13px;
    color: var(--gst-gray-600);
    font-weight: 500;
}

.invoice-details {
    display: grid;
    gap: 12px;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.invoice-row span:first-child {
    color: var(--gst-gray-600);
    font-weight: 500;
}

.invoice-row span:last-child {
    color: var(--gst-gray-900);
    font-weight: 600;
}

/* Responsive Design - Mobile */
@media (max-width: 640px) {
    .gst-calculator-pro {
        padding: 0 12px;
        margin: 20px auto;
    }
    
    .gst-calc-header {
        padding: 24px 20px;
    }
    
    .gst-calc-header h2 {
        font-size: 24px;
    }
    
    .gst-calc-form,
    .gst-results {
        padding: 24px 20px;
    }
    
    .gst-breakdown,
    .gst-invoice-summary {
        padding: 20px 16px;
    }
    
    .gst-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gst-download-btn {
        width: 100%;
    }
    
    .gst-breakdown-item .label,
    .gst-breakdown-item .value {
        font-size: 14px;
    }
    
    .gst-breakdown-item.gst-grand-total .label,
    .gst-breakdown-item.gst-grand-total .value {
        font-size: 18px;
    }
    
    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Tablet Responsive */
@media (min-width: 641px) and (max-width: 1024px) {
    .gst-calculator-pro {
        padding: 0 16px;
        margin: 30px auto;
    }
}

/* Print Styles for PDF Generation */
@media print {
    .gst-calculator-pro {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .gst-calc-header {
        background: white !important;
        color: black !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .gst-calc-form,
    .gst-calc-btn {
        display: none !important;
    }
    
    .gst-results {
        padding: 20px;
        background: white;
    }
    
    .gst-download-btn {
        display: none !important;
    }
    
    .gst-breakdown,
    .gst-invoice-summary {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .gst-calc-container {
        box-shadow: none;
        border: none;
    }
}

/* Loading State */
.gst-calc-loading {
    position: relative;
    pointer-events: none;
}

.gst-calc-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Focus Visible for Accessibility */
.gst-calc-btn:focus-visible,
.gst-download-btn:focus-visible {
    outline: 3px solid var(--gst-primary);
    outline-offset: 2px;
}

.gst-form-group input:focus-visible,
.gst-form-group select:focus-visible {
    outline: none;
    border-color: var(--gst-primary);
    box-shadow: 0 0 0 3px rgba(81, 177, 5, 0.2);
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* Utility Classes */
.gst-hidden {
    display: none !important;
}

.gst-visible {
    display: block !important;
}

/* Custom Scrollbar for Desktop */
@media (min-width: 1025px) {
    .gst-calc-container::-webkit-scrollbar {
        width: 8px;
    }
    
    .gst-calc-container::-webkit-scrollbar-track {
        background: var(--gst-gray-100);
    }
    
    .gst-calc-container::-webkit-scrollbar-thumb {
        background: var(--gst-gray-300);
        border-radius: 4px;
    }
    
    .gst-calc-container::-webkit-scrollbar-thumb:hover {
        background: var(--gst-gray-600);
    }
}