/* responsive.css */
/* Contains all @media queries for adjusting the layout and styles */
/* across different screen sizes (mobile, tablet, desktop). */

/* --- Responsive adjustments for Form/Value columns --- */
@media (max-width: 768px) { /* Tablet and smaller */
    .form-ad-container {
        flex-direction: column; /* Stack columns vertically */
        gap: 25px; /* Adjust gap for stacked layout */
    }
    .form-column,
    .value-column {
        flex: 1 1 100%; /* Allow columns to take full width when stacked */
        min-width: 100%;
    }
    .value-column { /* Adjust value column when stacked */
        padding-top: 0; /* Reset padding */
        order: 1; /* Place this column *before* the form inputs on mobile */
        background-color: transparent; /* Remove background when stacked */
        border: none; /* Remove border when stacked */
        padding: 0; /* Remove padding when stacked */
    }
    .form-column {
         order: 2; /* Ensure form is second */
    }
    .value-column h4 {
        text-align: center; /* Center heading on mobile */
    }
     .trust-signal {
        flex-wrap: wrap; /* Allow wrapping inside trust signal */
    }
    .resource-button {
        width: 100%; /* Make button full width */
        box-sizing: border-box;
    }
}

/* --- Responsive adjustments for Educational links columns --- */
@media (max-width: 600px) { /* Smaller tablets / large phones */
    .links-columns-container {
        flex-direction: column; /* Stack columns vertically */
        gap: 20px; /* Adjust gap for stacked layout */
    }
    .links-column {
        min-width: 100%; /* Allow columns to take full width when stacked */
    }

    /* Blog Grid */
    .blog-posts-container {
        /* Switch to 1 column on smaller screens */
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* --- General Mobile Responsiveness (Tablet Down) --- */
@media (max-width: 768px) {
    body { padding: 15px; }
    .calculator-container, .results, .success-stories, .educational-resources, .blog-container { padding: 20px; } /* Adjust padding */
    h1 { font-size: 2rem; } /* Adjust heading sizes */
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    button, .export-button { padding: 10px 15px; font-size: 1em; } /* Ensure buttons are easy to tap */
    #theme-toggle { padding: 6px 10px; font-size: 0.8em; top: 10px; right: 10px; }
    table, th, td { font-size: 0.9em; padding: 10px; } /* Slightly larger table padding */
    .page-description { font-size: 1rem; margin-bottom: 2rem; }
}

/* --- General Mobile Responsiveness (Phone) --- */
@media (max-width: 480px) {
     body { padding: 10px; font-size: 15px; }
     .calculator-container, .results, .success-stories, .educational-resources, .blog-container { padding: 15px; } /* Further adjust padding */
     h1 { font-size: 1.75rem; }
     h2 { font-size: 1.4rem; }
     h3 { font-size: 1.2rem; }
     h4 { font-size: 1.05rem; }
     input[type="text"], input[type="number"], select, button { font-size: 1em; }
     .input-group label[for="snowball"], .input-group label[for="avalanche"] { display: block; margin-left: 20px; margin-bottom: 5px; }
     .input-group input[type="radio"] { float: left; }
     /* Buttons stack */
     #debt-form button:not(#add-snowflake):not(.remove-snowflake-btn):not(#update-budget-recalculate) { /* Exclude specific buttons from full width */
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
     }
     #debt-form button:last-of-type { margin-bottom: 0; }
     .export-button { width: 100%; margin-top: 10px; margin-right: 0; margin-bottom: 10px; }
     /* Snowflake responsive */
     .snowflake-input-area { flex-direction: column; align-items: stretch; gap: 10px; }
     .snowflake-section > button#add-snowflake { width: 100%; margin-left: 0; margin-right: 0; margin-top: 15px; } /* Adjust snowflake button */
     .snowflake-input-area .input-group { min-width: 100%; }
     /* Footer responsiveness */
     .footer-links a { display: block; margin: 8px 0; } /* More space for tappable links */
     footer { padding: 15px 10px; font-size: 0.85em; }
     /* Table responsiveness */
     table, th, td { font-size: 0.85em; padding: 8px; } /* Adjust table padding */
     .page-description { font-size: 0.9375rem; margin-bottom: 1.5rem; }
}


/* --- Sticky Footer Ad (Mobile Only) --- */
.mobile-only {
    display: none; /* Hidden by default */
}

/* Apply sticky footer styles on smaller screens (e.g., max-width 768px) */
@media (max-width: 768px) {
    .ad-sticky-footer.mobile-only {
        display: flex; /* Show on mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 999; /* Ensure it's above other content */
        height: 15px; /* <-- Add this line */

        /* Styling is mostly handled in components.css now */
    }

    /* Add padding to the bottom of the body or margin to the main footer */
    /* to prevent the sticky ad from overlapping the footer content */
    /* Check if padding-bottom already exists from previous run */
    body {
        padding-bottom: 15px !important; /* Ensure this overrides existing styles, adjust value (ad height + buffer) */
    }
    /* Alternative commented out:
    footer {
        margin-bottom: 60px !important;
    }
    */
}
