/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content h1 i {
    margin-right: 0.5rem;
    color: #667eea;
}

.header-content p {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 1rem;
}

.info-banner {
    background: linear-gradient(135deg, #e6fffa, #b2f5ea);
    border: 1px solid #81e6d9;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #234e52;
    font-weight: 500;
}

.info-banner i {
    color: #319795;
}

/* Main Content */
.main-content {
    margin-bottom: 2rem;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.input-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-section h2 i {
    color: #667eea;
}

/* Section Cards */
.section-card {
    background: #f7fafc;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.section-card:hover {
    background: #edf2f7;
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.section-card:hover::before {
    width: 8px;
}

.section-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-card h3 i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Info Boxes */
.info-box {
    background: linear-gradient(135deg, #e6fffa, #b2f5ea);
    border: 1px solid #81e6d9;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #234e52;
}

.info-box p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-box ul {
    margin-left: 1rem;
    margin-bottom: 0;
}

.info-box li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* Form Styles */
.tax-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    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);
    transform: translateY(-2px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e0;
}

.form-group input[readonly] {
    background: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

.limit-text {
    color: #718096;
    font-size: 0.875rem;
    font-style: italic;
}

/* Enhanced Tooltip Styles */
.tooltip {
    position: relative;
    cursor: help;
    color: #667eea;
    transition: color 0.3s ease;
}

.tooltip:hover {
    color: #5a67d8;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
    z-index: 1000;
}

/* Calculate Button */
.calculate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

/* Output Section */
.output-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.output-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.output-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.output-section h2 i {
    color: #667eea;
}

/* Result Cards */
.result-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: #f7fafc;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.result-card:hover::before {
    transform: scaleX(1);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-card.highlight {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.result-card.highlight::before {
    background: rgba(255, 255, 255, 0.3);
}

.result-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #718096;
}

.result-card.highlight h3 {
    color: rgba(255, 255, 255, 0.9);
}

.result-card .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
}

.result-card.highlight .amount {
    color: white;
}

.result-card small {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Tax Breakdown */
.tax-breakdown,
.deduction-summary {
    margin-bottom: 2rem;
}

.tax-breakdown h3,
.deduction-summary h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tax-breakdown h3 i,
.deduction-summary h3 i {
    color: #667eea;
}

.breakdown-table {
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.breakdown-row:hover {
    background: #edf2f7;
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row.header {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.breakdown-row.header:hover {
    background: #667eea;
}

/* Tax Information Section */
.tax-info {
    margin-bottom: 2rem;
}

.tax-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tax-info h3 i {
    color: #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 1rem;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
}

.info-item h4 {
    color: #c53030;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-item p {
    color: #742a2a;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-btn,
.reset-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 150px;
    position: relative;
    overflow: hidden;
}

.download-btn::before,
.reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.download-btn:hover::before,
.reset-btn:hover::before {
    left: 100%;
}

.download-btn {
    background: #48bb78;
    color: white;
}

.download-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.reset-btn {
    background: #ed8936;
    color: white;
}

.reset-btn:hover {
    background: #dd6b20;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 137, 54, 0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.disclaimer {
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 1rem;
    color: #742a2a;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsive Tax Breakdown Table */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .input-section,
    .output-section {
        padding: 1.5rem;
    }
    
    /* Enhanced Mobile Tax Breakdown Table */
    .breakdown-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .breakdown-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
        min-width: 100%;
    }
    
    .breakdown-row.header {
        display: none; /* Hide header on mobile */
    }
    
    .breakdown-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background: #f7fafc;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    
    .breakdown-row > div:before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        flex: 1;
    }
    
    /* Add data labels for mobile */
    .breakdown-row > div:nth-child(1):before {
        content: "Tax Slab: ";
    }
    
    .breakdown-row > div:nth-child(2):before {
        content: "Taxable Amount: ";
    }
    
    .breakdown-row > div:nth-child(3):before {
        content: "Tax: ";
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .download-btn,
    .reset-btn {
        min-width: auto;
    }
    
    .tooltip:hover::after {
        max-width: 250px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .input-section,
    .output-section {
        padding: 1rem;
    }
    
    .result-card .amount {
        font-size: 1.5rem;
    }
    
    .section-card {
        padding: 1rem;
    }
    
    .info-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Error Styles */
.error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success Animation */
.success-animation {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Scroll Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-card {
    animation: fadeInUp 0.6s ease-out;
}

.section-card:nth-child(2) {
    animation-delay: 0.1s;
}

.section-card:nth-child(3) {
    animation-delay: 0.2s;
}

.section-card:nth-child(4) {
    animation-delay: 0.3s;
}

.section-card:nth-child(5) {
    animation-delay: 0.4s;
}

.section-card:nth-child(6) {
    animation-delay: 0.5s;
}

