/* Calculator Specific Styles */

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #4A90E2 0%, #2E5F8A 100%);
    padding: 8rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: slideInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    animation: slideInUp 1s ease-out 0.2s both;
}

.hero-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 1rem auto 0;
    line-height: 1.7;
    animation: slideInUp 1s ease-out 0.4s both;
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
    min-height: 80vh;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInScale 0.8s ease-out;
    border: 1px solid rgba(74, 144, 226, 0.1);
}

.calculator-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #F5F5F5;
}

.calculator-header h2 {
    color: #2E5F8A;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.calculator-header p {
    color: #666;
    font-size: 1rem;
}

/* Form Styles */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group {
    animation: slideInLeft 0.6s ease-out;
    margin-bottom: 1.5rem;
    display: flex;
    /* Side-by-side layout */
    align-items: center;
    gap: 20px;
}

.input-group:nth-child(2) {
    animation-delay: 0.1s;
}

.input-group:nth-child(3) {
    animation-delay: 0.2s;
}

.input-group:nth-child(4) {
    animation-delay: 0.3s;
}

.input-label {
    display: block;
    font-weight: 500;
    color: #2E5F8A;
    margin-bottom: 0;
    /* Remove bottom margin for side-by-side */
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 0 0 45%;
    /* Label takes 45% width */
}

.input-row {
    display: flex;
    gap: 1rem;
    flex: 1;
    /* Inputs take remaining space */
}

.input-field {
    position: relative;
    flex: 1;
}

.input-field.full-width {
    flex: 1;
}

.input-field input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    line-height: normal;
    /* Fix for text cropping */
    height: auto;
}

.input-field input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.input-field input:hover {
    border-color: #4A90E2;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
    pointer-events: none;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    animation: slideInUp 0.6s ease-out 0.4s both;
}

.calculate-btn,
.reset-btn,
.export-pdf-btn,
.export-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.calculate-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.reset-btn {
    background: #F5F5F5;
    color: #666;
    border: 2px solid #E0E0E0;
}

.reset-btn:hover {
    background: #E0E0E0;
    transform: translateY(-2px);
}

.export-pdf-btn,
.export-btn {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.export-pdf-btn:hover,
.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #F5F5F5;
    animation: slideInUp 0.6s ease-out;
}

.results-section.hidden {
    display: none;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h3 {
    color: #2E5F8A;
    font-size: 1.5rem;
    font-weight: 600;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 10px;
    border-left: 4px solid #E0E0E0;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-item.highlight {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    border-left-color: #4A90E2;
}

.result-item.primary {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border-left-color: #4CAF50;
}

.result-label {
    font-weight: 500;
    color: #333;
}

.result-value {
    font-weight: 600;
    color: #2E5F8A;
    font-size: 1.1rem;
}

.result-item.primary .result-value {
    color: #4CAF50;
    font-size: 1.3rem;
}

/* Service Exporter Specifics */
.option-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid #F0F3F7;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.option-section:hover {
    border-color: #1B9C4A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 156, 74, 0.1);
}

.option-title {
    font-size: 1.5rem;
    color: #062124;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.option-subtitle {
    color: #3F444B;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.results-display-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #F8FAFC;
    border-radius: 10px;
    border: 2px solid #E6E6E6;
}

.results-display-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: white;
    resize: vertical;
}

.tax-summary-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #F0F3F7 0%, #F8FAFC 100%);
    border-radius: 10px;
    border: 1px solid #E6E6E6;
}

.tax-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tax-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tax-summary-item:hover {
    transform: translateY(-2px);
}

.tax-label {
    font-size: 0.9rem;
    color: #3F444B;
    margin-bottom: 0.5rem;
    text-align: center;
}

.tax-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #062124;
    text-align: center;
}

.brackets-container {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.bracket-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 1rem;
    padding: 0.8rem;
    background-color: #FDFDFD;
    border-radius: 8px;
    border: 1px solid #F0F0F0;
    transition: all 0.3s ease;
}

.bracket-item:hover {
    background-color: #F0F3F7;
    transform: translateX(5px);
}

.income-band-table {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #F8FAFC;
    border-radius: 10px;
    border: 1px solid #E6E6E6;
}

.band-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.band-table th,
.band-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #F0F0F0;
}

.band-table th {
    background-color: #062124;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.annual-brackets-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #F8FAFC;
    border-radius: 10px;
    border: 1px solid #E6E6E6;
}

.annual-info p {
    padding: 0.8rem;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #1B9C4A;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.summary-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #F0F3F7;
    border-radius: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #E6E6E6;
}

.summary-item.total-tax {
    font-size: 1.2rem;
    font-weight: 700;
    color: #062124;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.final-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #062124 0%, #0C4539 100%);
    color: white;
    border-radius: 10px;
}

.final-summary .summary-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.3), transparent);
    animation: loading 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .calculator-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .input-row {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-value {
        align-self: flex-end;
    }

    .bracket-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tax-summary-grid {
        grid-template-columns: 1fr;
    }
}