/* Financial Calculators Page Specific Styles */

/* Page Container */
.financial-calculators-page {
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 20px 0;
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #4472c4;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* Page Header */
.page-header {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    color: #333;
    font-weight: 600;
}

.page-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Main Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Calculator Categories Section */
.calculator-categories {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-section {
    margin-bottom: 40px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 22px;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4472c4;
    font-weight: 600;
}

.calculator-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
}

.calculator-list li {
    padding: 0;
}

.calculator-list a {
    color: #4472c4;
    text-decoration: none;
    font-size: 15px;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.calculator-list a:hover {
    color: #2952a3;
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Box */
.search-box {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    border-color: #4472c4;
}

.search-form button {
    padding: 10px 20px;
    background-color: #4472c4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #2952a3;
}

/* Quick Links Box */
.quick-links-box {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-links-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links li {
    margin-bottom: 8px;
}

.quick-links li:last-child {
    margin-bottom: 0;
}

.quick-links a {
    color: #4472c4;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.quick-links a:hover {
    color: #2952a3;
    text-decoration: underline;
}

/* Category Tabs */
.category-tabs {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-tabs h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.tabs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tab-link {
    display: block;
    padding: 10px 15px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-link:hover {
    background-color: #e9e9e9;
}

.tab-link.active {
    background-color: #4472c4;
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-list {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        display: flex;
        flex-direction: column;
    }
    
    .calculator-section {
        order: 1;
    }
    
    .sidebar,
    #sidebar-container {
        order: 2;
        margin-top: 30px;
    }
    
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .calculator-container {
        padding: 0 15px;
    }
    
    .calculator-categories,
    .search-box,
    .quick-links-box,
    .category-tabs {
        padding: 20px;
    }
    
    /* Form improvements for mobile */
    .calculator-form {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .form-row label {
        flex: none;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .input-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .form-input {
        flex: 1;
        min-width: 120px;
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .small-input {
        width: 100%;
        max-width: 150px;
    }
    
    .percentage-input {
        width: 100%;
        max-width: 120px;
    }
    
    .currency-symbol {
        padding: 12px;
        min-width: 50px;
    }
    
    select {
        padding: 12px;
        font-size: 16px;
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        max-width: 200px;
    }
    
    /* Button improvements */
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .calculate-btn,
    .clear-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        min-height: 48px; /* Better touch target */
    }
    
    /* Table responsiveness */
    .breakdown-table {
        font-size: 14px;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 8px;
    }
    
    /* Results section mobile */
    .monthly-payment-display {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .monthly-payment-display .amount {
        font-size: 2rem;
        margin: 10px 0;
    }
    
    .copy-btn {
        margin-left: 0;
        margin-top: 10px;
        padding: 10px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 24px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-form input {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .search-form button {
        width: 100%;
        padding: 12px;
        min-height: 48px;
    }
    
    .calculator-container {
        padding: 0 10px;
    }
    
    .calculator-categories,
    .search-box,
    .quick-links-box,
    .category-tabs {
        padding: 15px;
    }
    
    /* Extra small screen form adjustments */
    .form-input {
        padding: 14px;
        font-size: 16px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .currency-symbol {
        border-radius: 4px 4px 0 0;
        border-bottom: none;
    }
    
    .form-input {
        border-radius: 0 0 4px 4px;
    }
    
    .monthly-payment-display .amount {
        font-size: 1.8rem;
    }
    
    /* Improve table readability on very small screens */
    .breakdown-table {
        font-size: 13px;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 6px 4px;
    }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .calculate-btn,
    .clear-btn {
        width: 48%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .form-input:focus {
        border-color: #4472c4;
        box-shadow: 0 0 0 3px rgba(68, 114, 196, 0.2);
    }
    
    .calculate-btn:active,
    .clear-btn:active {
        transform: scale(0.98);
    }
    
    .copy-btn:active {
        transform: scale(0.95);
    }
}
