/*
 * Styles for the Main Site Footer
 * VERSION 2.3: Added 4-Column Grid & Footer Country Selector (Dropup).
 */

.site-footer {
    background-color: var(--py-secondary-color);
    color: #e2e8f0;
    padding: 60px 0 30px; /* Thodi padding barhai hai */
    margin-top: 40px;
}

/* ==========================================================================
   1. 4-Column Widget Grid
   ========================================================================== */
.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Equal Columns */
    gap: 30px;
    margin-bottom: 40px;
    border-bottom: 1px solid #2d3748;
    padding-bottom: 40px;
}

/* Widget Title Styling */
.footer-widget .widget-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--py-primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

/* Widget List Styling */
.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    margin-bottom: 12px;
}

.footer-widget ul li a {
    color: #a0aec0;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-block;
}

.footer-widget ul li a:hover {
    color: #fff;
    transform: translateX(5px); /* Subtle hover effect */
}

/* ==========================================================================
   2. Footer Bottom Bar (Copyright + Country Selector)
   ========================================================================== */
.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 10px;
}

.site-info {
    text-align: left; /* Default left align for desktop */
    font-size: 14px;
    color: #718096;
}

.site-info p {
    margin: 0 0 5px 0;
}

.site-info .footer-links {
    display: flex;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-info .footer-links a {
    color: #718096;
    text-decoration: none;
}

.site-info .footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==========================================================================
   3. Footer Country Selector (Dropup Style)
   ========================================================================== */
.footer-country-selector {
    position: relative;
}

/* Toggle Button Style (Dark Theme) */
.country-dropdown-toggle.footer-toggle {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #4a5568;
    color: #e2e8f0;
    padding: 8px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: space-between;
}

.country-dropdown-toggle.footer-toggle:hover,
.country-dropdown-toggle.footer-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #cbd5e0;
    color: #fff;
}

.country-name-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dropup Menu (Opens Upwards) */
.country-dropdown-menu.dropup .country-dropdown-list {
    top: auto;
    bottom: 100%; /* Position above the button */
    margin-bottom: 10px; /* Space between button and list */
    right: 0;
    left: auto;
    background-color: #fff; /* White bg for readability */
    color: #333;
    border-radius: 8px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    border: 1px solid #e2e8f0;
    display: none;
    position: absolute;
    list-style: none;
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.country-dropdown-menu.dropup .country-dropdown-list.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdown Items */
.country-dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.country-dropdown-list li a:hover {
    background-color: #f7fafc;
    color: var(--py-primary-color);
}

/* ==========================================================================
   4. Back to Top Button Styles
   ========================================================================== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--py-primary-color);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 995;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 18px;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: var(--py-primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* ==========================================================================
   5. Responsive Adjustments
   ========================================================================== */

/* Tablet (2 Columns) */
@media (max-width: 992px) {
    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (1 Column) */
@media (max-width: 768px) {
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom-bar {
        flex-direction: column-reverse; /* Country selector on top of copyright on mobile */
        text-align: center;
        gap: 25px;
    }

    .site-info {
        text-align: center;
        width: 100%;
    }

    .site-info .footer-links {
        justify-content: center;
    }

    .footer-country-selector {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .country-dropdown-toggle.footer-toggle {
        width: 100%; /* Full width button on mobile */
        max-width: 300px;
    }

    .country-dropdown-menu.dropup .country-dropdown-list {
        width: 100%;
        left: 0;
        right: 0;
    }

    /* Back to Top Adjustment */
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}