/* ==========================================================================
   CarePDF - Footer Styles (Optimized & Responsive)
   ========================================================================== */

/* ==========================================================================
   1. Footer Base
   ========================================================================== */

.footer {
    background: linear-gradient(180deg, #111118 0%, #0a0a0f 100%);
    color: var(--gray-400);
    padding: 64px 0 24px;
    margin-top: auto;
}

/* ==========================================================================
   2. Footer Grid Layout
   ========================================================================== */

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   3. Footer About / Brand Column
   ========================================================================== */

.footer-about {
    max-width: 300px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-family-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.footer-brand:hover {
    opacity: 0.9;
}

.footer-brand .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9375rem;
    border-radius: 9px;
}

.footer-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ==========================================================================
   4. Footer Social Links
   ========================================================================== */

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-social a svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   5. Footer Columns & Links
   ========================================================================== */

.footer-column h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li a {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 2px 0;
}

.footer-links li a:hover {
    color: #ffffff;
    transform: translateX(3px);
}

/* ==========================================================================
   6. Footer Bottom
   ========================================================================== */

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.footer-bottom-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   7. Footer Language Selector
   ========================================================================== */

.footer-lang-wrapper {
    position: relative;
}

.footer-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.footer-lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.footer-lang-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.footer-lang-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: all 0.2s ease;
    z-index: 100;
}

.footer-lang-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.footer-lang-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.15s ease;
}

.footer-lang-menu a:first-child {
    border-radius: 11px 11px 0 0;
}

.footer-lang-menu a:last-child {
    border-radius: 0 0 11px 11px;
}

.footer-lang-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.footer-lang-menu a.active {
    background: rgba(239, 68, 68, 0.15);
    color: var(--primary-400);
}

/* Scrollbar */
.footer-lang-menu::-webkit-scrollbar {
    width: 5px;
}

.footer-lang-menu::-webkit-scrollbar-track {
    background: transparent;
}

.footer-lang-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ==========================================================================
   8. Responsive - Tablet (1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .footer-grid {
        gap: 32px;
    }
    
    .footer-about {
        max-width: 260px;
    }
}

/* ==========================================================================
   9. Responsive - Small Tablet (768px)
   ========================================================================== */

@media (max-width: 768px) {
    .footer {
        padding: 48px 0 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .footer-about {
        grid-column: span 2;
        max-width: 100%;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-description {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-social {
        justify-content: center;
    }
    
    .footer-column {
        text-align: left;
    }
}

/* ==========================================================================
   10. Responsive - Mobile (480px)
   ========================================================================== */

@media (max-width: 480px) {
    .footer {
        padding: 40px 0 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-about {
        grid-column: span 1;
    }
    
    .footer-description {
        font-size: 0.8125rem;
    }

    .footer-column {
        text-align: center;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .footer-column:first-of-type {
        border-top: none;
        padding-top: 0;
    }

    .footer-column h4 {
        margin-bottom: 12px;
    }
    
    .footer-links {
        gap: 8px;
    }

    .footer-links li a:hover {
        transform: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .footer-copyright {
        order: 2;
        font-size: 0.75rem;
    }
    
    .footer-bottom-actions {
        order: 1;
    }
    
    .footer-lang-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
    
    .footer-lang-menu {
        right: 50%;
        transform: translateX(50%) translateY(8px) scale(0.98);
    }
    
    .footer-lang-menu.show {
        transform: translateX(50%) translateY(0) scale(1);
    }
}

/* ==========================================================================
   11. RTL Support
   ========================================================================== */

[dir="rtl"] .footer-links li a:hover {
    transform: translateX(-3px);
}

[dir="rtl"] .footer-lang-menu {
    right: auto;
    left: 0;
}

@media (max-width: 480px) {
    [dir="rtl"] .footer-lang-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(8px) scale(0.98);
    }
    
    [dir="rtl"] .footer-lang-menu.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ==========================================================================
   12. Light Mode Support (if needed)
   ========================================================================== */

[data-theme="light"] .footer {
    background: linear-gradient(180deg, var(--gray-900) 0%, #0a0a0f 100%);
}

/* ==========================================================================
   13. Print Styles
   ========================================================================== */

@media print {
    .footer {
        display: none;
    }
}
