/* ====================================
   Loan Calculator - Complete Styling
   ==================================== */

/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #10b981;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '💰💳';
    position: absolute;
    font-size: 300px;
    opacity: 0.05;
    top: -50px;
    right: -50px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: #f8f9fa;
}

/* Calculator Root */
.calculator-root {
    max-width: 1400px;
    margin: 0 auto;
}

/* Calculator Layout */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

/* Input Panel */
.input-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Loan Types */
.loan-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.loan-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 14px;
}

.loan-type-btn:hover {
    border-color: #10b981;
    background: #d1fae5;
}

.loan-type-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.type-icon {
    font-size: 28px;
}

/* Calculator Form */
.calculator-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid rgba(16, 185, 129, 0.1);
}

.calculator-form h3 {
    color: #10b981;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
}

/* Input Groups */
.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.label-text {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.label-value {
    font-weight: 700;
    color: #10b981;
    font-size: 16px;
    background: #d1fae5;
    padding: 4px 12px;
    border-radius: 6px;
}

/* Sliders */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #e5e7eb, #10b981);
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    border: 4px solid #10b981;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 4px solid #10b981;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Number Inputs */
.number-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.number-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Term Selector */
.term-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.term-unit-btn {
    flex: 1;
    padding: 10px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
}

.term-unit-btn:hover {
    border-color: #10b981;
}

.term-unit-btn.active {
    background: #10b981;
    color: white;
    border-color: transparent;
}

/* Optional Group */
.optional-group {
    padding-top: 20px;
    border-top: 2px dashed #e5e7eb;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 17px;
    margin-top: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    background: white;
    border: 2px solid #e5e7eb;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    border-color: #10b981;
    color: #10b981;
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Payment Summary */
.payment-summary {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
    border: 3px solid #10b981;
}

.payment-summary h3 {
    color: #065f46;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.monthly-payment {
    font-size: 56px;
    font-weight: 900;
    color: #064e3b;
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.payment-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
}

.breakdown-label {
    color: #6b7280;
    font-weight: 600;
}

.breakdown-value {
    color: #1f2937;
    font-weight: 700;
    font-size: 16px;
}

.breakdown-item.total {
    background: #064e3b;
    color: white;
    border: 2px solid #065f46;
}

.breakdown-item.total .breakdown-label,
.breakdown-item.total .breakdown-value {
    color: white;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 2px solid #e5e7eb;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #10b981;
}

.summary-card.highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
}

.card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.card-value {
    font-size: 20px;
    font-weight: 900;
    color: #1f2937;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.chart-container h4 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.pie-chart {
    display: flex;
    align-items: center;
    gap: 30px;
}

.pie-chart svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.chart-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.principal {
    background: #10b981;
}

.legend-color.interest {
    background: #ef4444;
}

.legend-text {
    font-size: 14px;
    color: #6b7280;
}

.legend-text strong {
    color: #1f2937;
}

/* Amortization Section */
.amortization-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    color: #10b981;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.schedule-summary {
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    text-align: center;
}

.schedule-summary p {
    color: #6b7280;
    margin: 0;
}

.schedule-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-table thead {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.schedule-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.schedule-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.schedule-table tbody tr:hover {
    background: #f9fafb;
}

.schedule-table tbody tr:nth-child(12n) {
    background: #eff6ff;
    border-bottom: 2px solid #3b82f6;
}

.schedule-table td {
    padding: 12px 15px;
    color: #1f2937;
}

.schedule-table tbody tr:nth-child(12n) td {
    font-weight: 700;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid #3b82f6;
    padding: 30px;
    border-radius: 15px;
}

.info-box h4 {
    color: #1e40af;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

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

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 14px;
    color: #555;
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.info-item strong {
    color: #1e40af;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

/* SEO Content Section */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: #10b981;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #10b981;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-size: 15px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
}

.notification-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .loan-types {
        grid-template-columns: 1fr;
    }
    
    .monthly-payment {
        font-size: 42px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .pie-chart {
        flex-direction: column;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
}

@media (max-width: 520px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 28px;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-separator {
        display: none;
    }
    
    .monthly-payment {
        font-size: 36px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .header-actions .btn-small {
        width: 100%;
    }
    
    .notification-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 14px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
.schedule-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.schedule-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.schedule-table-wrapper::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 4px;
}

.schedule-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #059669;
}