/**
 * =====================================================================================
 * GLOBAL FOOTER STYLES
 * =====================================================================================
 * 
 * Complete styling for the NEW global footer component
 * CRITICAL: This is completely independent from the sticky mobile footer (.bottom-nav)
 * 
 * STRUCTURE:
 *   - Row 1: Main content (4 columns: brand, main menu, secondary menu, contact)
 *   - Row 2: Social & communication links
 *   - Row 3: Copyright
 * 
 * RESPONSIVE:
 *   - Desktop: Full 4-column layout
 *   - Tablet: 2-column layout
 *   - Mobile: Single column stack
 * 
 * NO INTERFERENCE: This footer does not touch or modify .bottom-nav styles
 * =====================================================================================
 */

/* ==================== FOOTER CONTAINER ==================== */
.global-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    margin-top: 60px;
    padding-bottom: 0; /* Remove extra padding - let mobile footer handle its own space */
    position: relative;
    clear: both; /* Ensure footer clears any floated content */
}

/* ==================== ROW 1: MAIN CONTENT (3 COLUMNS) ==================== */
.global-footer__main {
    padding: 60px 0 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.global-footer__grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.5fr; /* Brand | Menus (2-col) | Contact */
    gap: 40px;
}

/* Column Styles */
.global-footer__col {
    /* Base column styles */
}

.global-footer__col--brand {
    /* Brand column (wider) */
}

.global-footer__col--contact {
    /* Contact column (widest) */
}

/* ==================== MENUS WRAPPER (2 COLUMNS SIDE-BY-SIDE) ==================== */
.global-footer__menus-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.global-footer__desktop-quick-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 10px;
}

.global-footer__heading--desktop-quick {
    grid-column: 1 / -1;
    margin-bottom: 16px;
}

.global-footer__desktop-quick-group .global-footer__col--menu-desktop,
.global-footer__desktop-quick-group .global-footer__menu-item {
    min-width: 0;
}

.global-footer__desktop-quick-group .global-footer__link {
    display: block;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.88rem;
    text-align: right;
    direction: rtl;
}

.global-footer__desktop-quick-group .global-footer__link > span {
    display: inline-block;
    width: 100%;
    text-align: justify;
    text-align-last: right;
    text-justify: inter-word;
    white-space: nowrap;
}

.global-footer__desktop-quick-group .global-footer__link > span::after {
    content: '';
    display: inline-block;
    width: 100%;
}

.global-footer__col--menu-mobile {
    display: none;
}

.global-footer__mobile-quick-group {
    display: none;
}

.global-footer__mobile-licenses {
    display: none;
}

.global-footer__desktop-licenses-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 18px;
}

.global-footer__licenses-divider {
    height: 1px;
    width: 236px;
    max-width: min(236px, calc(100% - 32px));
    margin: 0 auto 24px;
    background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.45) 14%, rgba(226, 232, 240, 0.95) 50%, rgba(148, 163, 184, 0.45) 86%, transparent 100%);
}

.global-footer__licenses-divider--mobile {
    display: none;
}

.global-footer__desktop-licenses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 96px));
    gap: 14px;
    justify-content: center;
    align-items: center;
}

.global-footer__license-card {
    text-decoration: none;
}

.global-footer__license-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.global-footer__license-card--desktop {
    display: block;
    width: 96px;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    padding: 7px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
}

/* ==================== COLUMN 1: BRAND ==================== */
.global-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.global-footer__logo {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.global-footer__logo-wrap {
    width: clamp(130px, 14vw, 230px);
    height: clamp(56px, 8vw, 96px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.global-footer__brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.global-footer__brand-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

/* ==================== COLUMN HEADINGS ==================== */
.global-footer__heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.5);
    position: relative;
}

.global-footer__heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

/* ==================== COLUMNS 2 & 3: MENUS ==================== */
.global-footer__menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.global-footer__menu-item {
    /* Menu item container */
}

.global-footer__link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 4px 0;
}

.global-footer__link:hover {
    color: #ffffff;
}

.global-footer__link i {
    font-size: 0.85rem;
    color: #3b82f6;
}

.global-footer__link:hover i {
    color: #60a5fa;
}

.global-footer__empty {
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

/* ==================== COLUMN 4: CONTACT INFORMATION ==================== */
.global-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.global-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.global-footer__contact-icon {
    color: #3b82f6;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.global-footer__contact-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.global-footer__contact-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==================== ROW 2: SOCIAL & COMMUNICATION ==================== */
.global-footer__social-row {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.global-footer__social-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.global-footer__social-section {
    /* Section container */
}

.global-footer__social-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
}

/* Social Media Links */
.global-footer__social-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.global-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #cbd5e1;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.global-footer__social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: currentColor;
    /* Remove transform to prevent shift */
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.global-footer__social-link i {
    /* Icon styling handled by parent color */
}

.global-footer__social-icon-file {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

/* Communication Links */
.global-footer__communication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.global-footer__communication-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.global-footer__communication-link:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #ffffff;
}

.global-footer__communication-link i {
    color: #3b82f6;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ==================== ROW 3: COPYRIGHT ==================== */
.global-footer__copyright {
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.2);
}

.global-footer__copyright-text {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Narrow Desktop (1024px - 1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
    .global-footer__grid {
        grid-template-columns: 1.05fr 2.35fr 1.1fr;
        gap: 26px;
    }

    .global-footer__menus-wrapper {
        grid-template-columns: minmax(0, 2.45fr) minmax(0, 1fr);
        gap: 20px;
    }

    .global-footer__desktop-quick-group {
        gap: 8px 8px;
    }

    .global-footer__desktop-quick-group .global-footer__link {
        font-size: 0.82rem;
        letter-spacing: -0.01em;
    }

    .global-footer__desktop-licenses {
        grid-template-columns: repeat(2, minmax(0, 88px));
        gap: 10px;
    }

    .global-footer__license-card--desktop {
        width: 88px;
        padding: 6px;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .global-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .global-footer__col--brand {
        grid-column: 1 / -1; /* Full width */
    }
    
    .global-footer__menus-wrapper {
        grid-column: 1 / -1; /* Full width but still 2 columns inside */
    }
    
    .global-footer__col--contact {
        grid-column: 1 / -1; /* Full width */
    }

    .global-footer__desktop-licenses {
        display: none;
    }

    .global-footer__desktop-licenses-row {
        display: none;
    }

    .global-footer__licenses-divider--desktop {
        display: none;
    }
    
    .global-footer__social-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    .global-footer {
        margin-top: 40px;
        padding-bottom: 0;
    }
    
    .global-footer__main {
        padding: 40px 0 30px;
    }
    
    /* Layout برای موبایل */
    .global-footer__grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    /* سطر 1: برند (تمام عرض) */
    .global-footer__col--brand {
        width: 100%;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .global-footer__brand {
        align-items: center;
    }
    
    .global-footer__logo {
        margin-left: auto;
        margin-right: auto;
    }

    .global-footer__logo-wrap {
        width: clamp(140px, 50vw, 240px);
        height: clamp(64px, 22vw, 100px);
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }
    
    /* سطر 2: دسترسی سریع موبایل (3 ستون) + اطلاعات (ستون 4) */
    .global-footer__menus-wrapper {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        align-items: start;
        width: 100%;
        margin-bottom: 30px;
    }

    .global-footer__col--menu-desktop {
        display: none;
    }

    .global-footer__desktop-quick-group {
        display: none;
    }

    .global-footer__mobile-quick-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        grid-column: 1 / 4;
        align-content: start;
    }

    .global-footer__heading--mobile-quick {
        grid-column: 1 / -1;
        margin: 0 0 15px 0;
    }

    .global-footer__col--menu-mobile {
        display: block;
        padding: 0 2px;
        min-width: 0;
    }

    .global-footer__col--menu-mobile .global-footer__menu {
        display: grid;
        grid-auto-rows: 2.05rem;
        align-content: start;
        gap: 8px;
    }

    .global-footer__col--menu-mobile .global-footer__menu-item {
        min-width: 0;
    }

    .global-footer__col--menu-mobile .global-footer__link {
        display: block;
        width: 100%;
        height: 100%;
        padding: 0 4px;
        border-radius: 0;
        font-size: clamp(0.7rem, 2.3vw, 0.78rem);
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        text-align: right;
        direction: rtl;
        background: transparent;
    }

    .global-footer__col--menu-mobile .global-footer__link > span {
        display: inline-block;
        width: 100%;
        text-align: justify;
        text-align-last: right;
        text-justify: inter-word;
        white-space: nowrap;
    }

    .global-footer__col--menu-mobile .global-footer__link > span::after {
        content: '';
        display: inline-block;
        width: 100%;
    }

    .global-footer__col--menu-mobile .global-footer__link i {
        display: none;
    }
    
    .global-footer__col--secondary {
        padding: 0 2px;
        margin-bottom: 0;
        box-sizing: border-box;
    }
    
    /* سطر 3: اطلاعات تماس (تمام عرض) */
    .global-footer__col--contact {
        width: 100%;
    }

    .global-footer__mobile-licenses {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .global-footer__desktop-licenses {
        display: none;
    }

    .global-footer__licenses-divider--mobile {
        display: block;
        width: 214px;
        max-width: calc(100% - 56px);
        margin: -2px auto 2px;
    }

    .global-footer__license-card {
        display: block;
        width: 86px;
        aspect-ratio: 1 / 1;
        background: #ffffff;
        border: 1px solid rgba(148, 163, 184, 0.45);
        border-radius: 12px;
        padding: 6px;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
    }
    
    .global-footer__heading {
        font-size: 1rem;
        text-align: right;
        margin-bottom: 15px;
    }
    
    .global-footer__menu {
        gap: 10px;
    }
    
    .global-footer__link {
        font-size: 0.85rem;
    }
    
    .global-footer__contact {
        gap: 12px;
    }
    
    .global-footer__contact-item {
        font-size: 0.85rem;
    }
    
    /* سطر 4: شبکه‌های اجتماعی + پشتیبانی */
    .global-footer__social-row {
        padding: 30px 0;
    }
    
    .global-footer__social-grid {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    /* آیکون‌های شبکه اجتماعی - 3 تا در یک سطر وسط */
    .global-footer__social-links {
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    
    .global-footer__social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* دکمه‌های پشتیبانی - همه در یک سطر */
    .global-footer__communication-links {
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
    }
    
    .global-footer__communication-link {
        padding: 8px 10px;
        font-size: 0.75rem;
        gap: 5px;
        flex-shrink: 0;
    }
    
    .global-footer__communication-link i {
        font-size: 0.85rem;
    }
    
    /* سطر 5: کپی‌رایت */
    .global-footer__copyright {
        padding: 20px 0;
    }
    
    .global-footer__copyright-text {
        font-size: 0.85rem;
        padding: 0 15px;
        text-align: center;
    }
}

/* Very Small Mobile (max 480px) */
@media (max-width: 480px) {
    .global-footer {
        padding-bottom: 0; /* Mobile footer handles its own spacing */
    }
    
    .global-footer__main {
        padding: 30px 0 25px;
    }
    
    .global-footer__grid {
        gap: 30px;
    }
    
    .global-footer__social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .global-footer__comm-link {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .global-footer__mobile-licenses {
        gap: 10px;
    }

    .global-footer__licenses-divider--mobile {
        width: 194px;
        max-width: calc(100% - 44px);
    }

    .global-footer__license-card {
        width: 78px;
        padding: 5px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .global-footer {
        background: #ffffff;
        color: #000000;
        margin-top: 30px;
        padding-bottom: 0;
    }
    
    .global-footer__main,
    .global-footer__social,
    .global-footer__copyright {
        border-color: #cccccc;
    }
    
    .global-footer__social {
        display: none; /* Hide social links in print */
    }
}

/* ==================== DARK MODE SUPPORT (Optional) ==================== */
@media (prefers-color-scheme: dark) {
    /* Footer already has dark theme, but can add adjustments if needed */
}

/* ==================== ACCESSIBILITY ==================== */
.global-footer__link:focus,
.global-footer__social-link:focus,
.global-footer__comm-link:focus,
.global-footer__contact-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .global-footer__link,
    .global-footer__social-link,
    .global-footer__comm-link,
    .global-footer__contact-link {
        transition: none;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.global-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 767px) {
    .global-footer .container {
        padding: 0 15px;
    }
}
