/* Loan Calculator Tool Styles */

/* Tool Container - Full Page Layout */
.loan-calculator-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.calculator-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Loan Type Selection */
.type-selection {
    margin-bottom: 1rem;
}

.type-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 10px;
}

.type-tab {
    background: transparent;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    min-height: 80px;
    justify-content: center;
}

.type-tab i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.type-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(167, 165, 165);
    transform: translateY(-2px);
}

.type-tab.active {
    background: rgb(80, 82, 82);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.type-tab.active i {
    color: white;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

.form-input {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:invalid {
    border-color: #ef4444;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Term Input Group */
.term-input-group {
    display: flex;
    gap: 0.5rem;
}

.term-input-group .form-input {
    flex: 2;
}

.term-select {
    flex: 1;
    padding: 0.875rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.term-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Action Controls */
.action-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.calculate-btn,
.clear-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.clear-btn {
    background: #f3f4f6;
    color: var(--text-dark);
}

.clear-btn:hover {
    background: #e5e7eb;
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
}

.result-display {
    background: white;
    border-radius: 12px;
    padding: 2rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.copy-result-btn {
    padding: 0.5rem;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-result-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Result Summary */
.result-summary {
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.summary-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.summary-item.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-color: var(--primary-color);
}

.summary-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.summary-item.primary .summary-label {
    color: rgba(255, 255, 255, 0.9);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.summary-item.primary .summary-value {
    color: white;
}

/* Breakdown Section */
.result-breakdown {
    margin-bottom: 2rem;
}

.breakdown-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.breakdown-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-step {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.step-formula {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.step-result {
    font-size: 0.875rem;
    color: var(--text-dark);
}

/* Amortization Summary */
.amortization-summary {
    margin-bottom: 2rem;
}

.amortization-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.amortization-chart {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.amortization-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.amortization-item:last-child {
    border-bottom: none;
}

.amortization-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.amortization-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Popular Examples */
.popular-examples {
    margin-top: 3rem;
    padding: 2rem 0;
}

.popular-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-title i {
    color: #fbbf24;
}

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

.example-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-item:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

.example-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.example-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.example-description {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: var(--primary-color);
}

.related-tools-header p {
    color: var(--text-light);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

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

.related-tool-link {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.related-tool-link i {
    font-size: 0.875rem;
}

/* SEO Content Styles */
.seo-content {
    background: white;
    margin-top: 3rem;
    padding: 3rem 0;
    border-top: 1px solid #e5e7eb;
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.seo-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

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

.seo-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.seo-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.seo-content ul,
.seo-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.seo-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.seo-content section {
    margin-bottom: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .type-tabs {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }

    .type-tab {
        min-height: 60px;
        font-size: 0.75rem;
        padding: 0.625rem 0.375rem;
        gap: 0.125rem;
    }

    .type-tab i {
        font-size: 1rem;
    }

    .type-tab span {
        white-space: nowrap;
        font-size: 0.7rem;
        line-height: 1.1;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .term-input-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .term-input-group .form-input,
    .term-select {
        flex: none;
    }

    .action-controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .calculate-btn,
    .clear-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .content-container {
        padding: 0 1rem;
    }

    .seo-content h2 {
        font-size: 1.375rem;
    }

    .seo-content h3 {
        font-size: 1.125rem;
    }

    .related-tools-section {
        padding: 1.5rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .related-tool-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .related-tools-section {
        padding: 1rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }

    .related-tool-link {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        text-align: left;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .type-tabs {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.125rem;
    }

    .type-tab {
        min-height: 50px;
        flex-direction: column;
        gap: 0.125rem;
        justify-content: center;
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }

    .type-tab i {
        font-size: 0.875rem;
    }

    .type-tab span {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .summary-value {
        font-size: 1.25rem;
    }

    .calculate-btn,
    .clear-btn {
        max-width: none;
        font-size: 0.9375rem;
        min-height: 52px;
    }
}
