/* Base Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: #333;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Tool Content */
.tool-content {
    max-width: 1000px;
    margin: -30px auto 3rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* Calculator Tool */
.calculator-tool {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.7rem;
    color: #333;
    font-weight: 600;
    font-size: 1.05rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 15px;
    color: #555;
    font-weight: 600;
    z-index: 10;
}

.input-suffix {
    position: absolute;
    right: 15px;
    color: #555;
    font-weight: 600;
    z-index: 10;
}

.input-group .form-control {
    padding-left: 30px;
}

.input-group .form-control[data-suffix] {
    padding-right: 65px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 1rem 0.5rem;
    cursor: pointer;
    position: relative;
    z-index: 1;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.3s ease;
}

.toggle-bg {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    height: calc(100% - 1rem);
    width: calc(33.33% - 0.67rem);
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-container.type-car-loan .toggle-bg {
    left: calc(33.33% + 0.25rem);
}

.toggle-container.type-personal-loan .toggle-bg {
    left: calc(66.66% - 0.25rem);
}

.toggle-option.active {
    color: var(--primary);
}

.toggle-option i {
    margin-right: 0.5rem;
}

/* Select Styling */
.custom-select {
    position: relative;
    display: block;
    width: 100%;
}

.custom-select select {
    width: 100%;
    padding: 0.9rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-select::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    pointer-events: none;
}

.custom-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

/* Form Layout */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-col {
    flex: 1;
    min-width: 230px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Button Styles */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(255, 71, 87, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 71, 87, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.2);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #555;
}

.btn-outline:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    margin-right: 0.5rem;
}

/* Results Section */
.results-container {
    display: none;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

/* Result Summary */
.result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-item {
    flex: 1;
    min-width: 160px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    text-align: center;
}

.summary-label {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    height: 300px;
}

/* Tabs */
.results-tabs {
    margin-bottom: 2rem;
}

.tab-header {
    display: flex;
    background: var(--light-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.tab-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
}

.tab-item.active {
    background-color: var(--primary);
    color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Result Panels */
.result-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #eee;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: #555;
    font-weight: 500;
}

.result-value {
    font-weight: 600;
    color: #333;
}

.result-value.highlight {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.result-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.result-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-section-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.data-table th, 
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(248, 249, 250, 0.5);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Examples Section */
.examples-container {
    margin-top: 2rem;
}

.example-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--blue);
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.example-title {
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 1rem;
}

.formula-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    overflow-x: auto;
}

.formula {
    font-family: 'Courier New', monospace;
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

/* Info Cards */
.info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.info-title {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-bg);
    font-size: 1.5rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: center;
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.share-facebook {
    background: #3b5998;
}

.share-twitter {
    background: #1da1f2;
}

.share-whatsapp {
    background: #25d366;
}

.share-email {
    background: #ea4335;
}

/* Features Grid */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
}

.feature-desc {
    color: var(--text-light);
}

/* Small Note */
.small-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Accordion for FAQs */
.accordion-item {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
}

.accordion-header {
    padding: 1.25rem;
    cursor: pointer;
    background-color: white;
    font-weight: 600;
    margin: 0;
    position: relative;
    border-bottom: 1px solid transparent;
}

.accordion-header::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    transition: all 0.3s ease;
}

.accordion-item.active .accordion-header::after {
    transform: translateY(-50%) rotate(90deg);
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: white;
}

.accordion-item.active .accordion-content {
    padding: 1.25rem;
    max-height: 1000px;
    border-top: 1px solid #eee;
}

.accordion-item.active .accordion-header {
    background-color: var(--light-bg);
    border-bottom-color: #eee;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design - Enhanced for Mobile */
@media (max-width: 1024px) {
    .tool-content {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .calculator-tool {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-col {
        min-width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .result-row {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }

    .result-value {
        align-self: flex-end;
    }
    
    .summary-item {
        min-width: 100%;
    }
    
    .tab-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }

    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
        width: calc(100% + 2rem);
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .toggle-option {
        padding: 0.75rem 0.25rem;
        font-size: 0.9rem;
    }

    .toggle-option i {
        margin-right: 0.3rem;
    }
    
    .summary-value {
        font-size: 1.2rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .tool-hero, 
    .share-buttons,
    .calculator-tool form,
    #header-container,
    #footer-container,
    .btn {
        display: none !important;
    }

    .tool-content {
        margin: 0;
        padding: 0;
    }

    .calculator-tool {
        box-shadow: none;
        padding: 0;
    }

    .results-container {
        display: block !important;
    }

    .result-panel,
    .summary-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .chart-container {
        height: 200px;
    }
}