/**
 * CTC Calculator Styles
 */

/* Reset and Base Styles */
.ctc-calculator-container * {
    box-sizing: border-box;
}

.ctc-calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
.ctc-calculator-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ctc-calculator-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    font-weight: 700;
}

.ctc-calculator-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Form Styles */
.ctc-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Advanced Options */
.advanced-options {
    margin-top: 20px;
    border-top: 1px solid #e1e5e9;
    padding-top: 20px;
}

.toggle-advanced {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 20px;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #555;
    transition: all 0.3s ease;
}

.toggle-advanced:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.toggle-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.toggle-advanced.active .toggle-icon {
    transform: rotate(45deg);
}

.advanced-content {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.advanced-content h4 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 1.1em;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

/* Results Section */
.ctc-results-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.results-actions {
    display: flex;
    gap: 10px;
}

.results-content {
    padding: 30px;
}

.results-card {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.results-card h4 {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.result-item .label {
    font-weight: 600;
    color: #555;
}

.result-item .value {
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
}

.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left-color: #764ba2;
}

.result-item.highlight .label,
.result-item.highlight .value {
    color: white;
}

/* Tax Suggestion */
.tax-suggestion {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.tax-suggestion h4 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.suggestion-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

/* Chart Styles */
.chart-card {
    background: white;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

/* History Section */
.ctc-history-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.history-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    margin: 0;
    color: #555;
}

.history-content {
    padding: 30px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.history-item-info {
    flex: 1;
}

.history-item-info .ctc-amount {
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
}

.history-item-info .details {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.history-item-actions {
    display: flex;
    gap: 10px;
}

.history-item-actions .btn {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Loading Overlay */
.ctc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.ctc-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ctc-calculator-container {
        padding: 10px;
        margin: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ctc-calculator-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .ctc-calculator-header h2 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .ctc-calculator-header p {
        font-size: 0.95em;
        line-height: 1.4;
    }
    
    .ctc-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        border-radius: 6px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .results-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .results-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .result-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .history-item-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .history-item-actions .btn {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .chart-container {
        height: 300px;
        margin: 15px 0;
    }
    
    /* Tax Regime Suggestion Mobile */
    .regime-comparison {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .regime-item {
        padding: 12px;
    }
    
    .suggestion-content {
        padding: 15px;
    }
    
    .savings-info {
        padding: 12px;
    }
    
    .savings-info p {
        font-size: 0.9em;
        margin: 6px 0;
        color: #000000;
    }
    
    .savings-info strong {
        color: #000000;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .ctc-calculator-container {
        padding: 5px;
    }
    
    .ctc-calculator-header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .ctc-calculator-header h2 {
        font-size: 1.5em;
        margin-bottom: 6px;
    }
    
    .ctc-calculator-header p {
        font-size: 0.9em;
    }
    
    .ctc-form {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 10px;
    }
    
    .results-content {
        padding: 15px;
    }
    
    .results-header {
        padding: 12px;
    }
    
    .results-actions {
        gap: 8px;
    }
    
    .results-actions .btn {
        font-size: 13px;
        padding: 8px 12px;
        min-width: 100px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .results-grid {
        gap: 8px;
    }
    
    .result-item {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .result-item .label {
        font-size: 0.9em;
    }
    
    .result-item .value {
        font-size: 1em;
    }
    
    .chart-container {
        height: 250px;
        margin: 10px 0;
    }
    
    .history-item {
        padding: 12px;
    }
    
    .history-item-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 80px;
    }
    
    /* Tax Regime Suggestion Small Mobile */
    .suggestion-content {
        padding: 12px;
    }
    
    .regime-item {
        padding: 10px;
    }
    
    .regime-label {
        font-size: 0.8em;
    }
    
    .regime-value {
        font-size: 1.1em;
    }
    
    .savings-info {
        padding: 10px;
    }
    
    .savings-info p {
        font-size: 0.85em;
        margin: 4px 0;
        color: #000000;
    }
    
    .savings-info strong {
        color: #000000;
        font-weight: 600;
    }
}

/* Tax Regime Suggestion Styles */
.tax-suggestion {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #28a745;
    color: #000000;
}

.tax-suggestion * {
    color: #000000;
}

.suggestion-content {
    padding: 20px;
}

.suggestion-header h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.regime-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.regime-item {
    padding: 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.regime-item.current {
    border-color: #007bff;
    background: #f8f9ff;
}

.regime-item.recommended {
    border-color: #28a745;
    background: #f8fff9;
}

.regime-label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.regime-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
}

.savings-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    color: #000000;
}

.savings-info * {
    color: #000000 !important;
}

.savings-info p {
    margin: 8px 0;
    font-size: 1em;
    color: #000000;
}

.savings-info strong {
    color: #000000;
    font-weight: 600;
}

/* Print Styles */
@media print {
    .ctc-calculator-header,
    .form-actions,
    .results-actions,
    .history-header,
    .ctc-loading-overlay,
    .ctc-messages {
        display: none !important;
    }
    
    .ctc-calculator-container {
        max-width: none;
        padding: 0;
    }
    
    .results-card {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}
