/* =========================================
   LOAN CONSOLIDATION CALCULATOR SPECIFIC STYLES
   ========================================= */

.calc-main {
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.calc-wrapper {
    width: 100%;
    max-width: 1100px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.calc-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.calc-header h1 {
    color: var(--dark-color);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.calc-header p {
    color: #555;
    font-size: 1.1rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

/* Panels */
.calc-panel {
    background: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.5);
    height: fit-content;
}

.panel-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(58, 123, 213, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.calc-panel h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0;
}

.mt-2 {
    margin-top: 2rem;
    border-bottom: 2px solid rgba(58, 123, 213, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Dynamic Debt Items */
.debt-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.debt-header h4 {
    color: var(--dark-color);
    margin: 0;
}

.remove-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(58, 123, 213, 0.4);
}

.add-btn:hover {
    background: #2e63af;
    transform: translateY(-2px);
}

/* Grid for Inputs */
.debt-input-grid, .new-loan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--dark-color);
    font-size: 0.85rem;
}

.input-group input, .input-group select {
    padding: 0.7rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.2);
}

/* Button */
.calc-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: var(--text-light);
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(60, 87, 116, 0.4);
}

/* Results Display */
.result-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 0.8rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.result-box.highlight {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.result-box h4 {
    color: var(--dark-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.result-box.highlight .result-value {
    color: var(--success-color);
}

.result-details {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .debt-input-grid, .new-loan-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   HEADER TEXT ALIGNMENT
   ========================================= */
.header-text-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 0 1.5rem;
    text-align: center; /* Centers the text to match the calculator aesthetic */
}

.header-text-wrapper .calculator-title {
    color: var(--dark-color);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.header-text-wrapper .calculator-subtitle {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.header-text-wrapper .section-title {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.header-text-wrapper .section-text {
    color: #4A4A4A;
    font-size: 1rem;
    line-height: 1.6;
}

/* =========================================
   DEBT ITEM ENHANCEMENTS (EDITABLE TITLE & COLLAPSE)
   ========================================= */

.debt-header-left {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.debt-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Editable Title Input */
.debt-title-input {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 4px;
    padding: 2px 5px;
    width: 100%;
    max-width: 250px;
    transition: all 0.3s ease;
    margin-left: -5px; /* Aligns visually with the edge */
}

.debt-title-input:hover {
    border-color: rgba(58, 123, 213, 0.4);
    background: rgba(255, 255, 255, 0.5);
}

.debt-title-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Summary Text (Hidden by default) */
.debt-summary {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 5px;
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
}

/* Collapse Button */
.collapse-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark-color);
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.collapse-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Collapsed State Styles */
.debt-item.collapsed .debt-body {
    display: none;
}

.debt-item.collapsed .debt-summary {
    display: block;
    opacity: 1;
}

.debt-item.collapsed .collapse-btn {
    transform: rotate(180deg); /* Flips the arrow upside down */
}

/* =========================================
   DEBT BREAKDOWN LIST (RESULTS PANEL)
   ========================================= */
.debt-breakdown-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.debt-breakdown-container h4 {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: left;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for the breakdown list */
.breakdown-list::-webkit-scrollbar {
    width: 6px;
}
.breakdown-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.breakdown-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.breakdown-item-header {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.breakdown-item-type {
    font-size: 0.75rem;
    background: var(--nav-bg);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
}

.breakdown-item-details {
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
}

.breakdown-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* =========================================
   SEO & FAQ CONTENT SECTION
   ========================================= */
.seo-content-container {
    display: flex;
    justify-content: center;
    padding: 0 1.5rem 4rem 1.5rem;
}

.seo-card {
    width: 100%;
    max-width: 1100px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    padding: 3rem;
}

.seo-card .section-title {
    text-align: center;
    color: var(--dark-color);
    margin-bottom: 2.5rem;
    font-size: 2rem;
}

.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.faq-item p {
    color: #4A4A4A;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.faq-list {
    list-style-type: none;
    padding-left: 0;
}

.faq-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.8rem;
    color: #4A4A4A;
    line-height: 1.6;
}

/* Custom Bullet Points */
.faq-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Responsive Adjustments for Mobile */
@media (max-width: 768px) {
    .seo-card {
        padding: 2rem 1.5rem;
    }
    
    .seo-card .section-title {
        font-size: 1.6rem;
    }
    
    .faq-item h3 {
        font-size: 1.15rem;
    }
}