/* ========== FOOTER - COMPLETE RESPONSIVE SYSTEM ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a5f;
    --secondary: #2c5aa0;
    --accent: #4a90e2;
    --gold: #d4af37;
    --light: #f8fafc;
    --dark: #0f172a;
    --card-bg: #1e293b;
    --gray: #94a3b8;
    --text-main: #e2e8f0;
    --gradient: linear-gradient(135deg, #1e3a5f 0%, #4a90e2 100%);
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: var(--dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
}

html {
    overflow-x: hidden;
}

/* ========== BASE FOOTER STYLES ========== */
footer {
    background: linear-gradient(180deg, #0a0f1a 0%, #0f172a 100%);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 3rem;
    border-top: 2px solid rgba(212, 175, 55, 0.2);
    width: 100%;
    position: relative;
    overflow: visible;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--gold) 50%, 
        transparent 100%);
    opacity: 0.3;
}

/* ========== FOOTER GRID ========== */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto 3rem;
    width: 100%;
}

/* ========== FOOTER SECTIONS ========== */
.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-section h4 {
    font-family: 'Kufam', serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--gold);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
    position: relative;
    padding-bottom: 0.8rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    font-size: 0.95rem;
    word-wrap: break-word;
    text-align: justify;
}

/* ========== FOOTER LINKS ========== */
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-block;
    position: relative;
    padding-right: 0.5rem;
}

.footer-section a::before {
    content: '◂';
    position: absolute;
    right: -15px;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--gold);
}

.footer-section a:hover {
    color: var(--gold);
    transform: translateX(-5px);
}

.footer-section a:hover::before {
    opacity: 1;
    right: 0;
}

/* ========== FOOTER DIVIDER ========== */
.footer-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 2rem auto;
    border-radius: 2px;
    position: relative;
}

.footer-divider::before,
.footer-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.footer-divider::before {
    left: -15px;
}

.footer-divider::after {
    right: -15px;
}

/* ========== FOOTER BOTTOM ========== */
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-bottom p {
    margin: 0.8rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-bottom p:first-child {
    font-weight: 600;
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-size: 1rem;
}

.footer-bottom p:last-child {
    font-family: 'Kufam', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1rem;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* EXTRA LARGE DESKTOP (1400px+) */
@media (min-width: 1400px) {
    footer {
        padding: 5rem 3rem 2.5rem;
    }
    
    .footer-grid {
        gap: 4rem;
    }
}

/* LARGE DESKTOP (1200px - 1399px) */
@media (max-width: 1399px) {
    footer {
        padding: 4rem 2rem 2rem;
    }
}

/* MEDIUM DESKTOP (1024px - 1199px) */
@media (max-width: 1199px) {
    footer {
        padding: 3.5rem 1.5rem 2rem;
    }
    
    .footer-grid {
        gap: 2.5rem;
    }
    
    .footer-section h4 {
        font-size: 1.3rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.9rem;
    }
}

/* SMALL DESKTOP / LARGE TABLET (900px - 1023px) */
@media (max-width: 1023px) {
    footer {
        padding: 3rem 1.5rem 2rem;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 2rem;
    }
    
    .footer-section h4 {
        font-size: 1.25rem;
        margin-bottom: 0.8rem;
    }
}

/* TABLET (768px - 899px) */
@media (max-width: 899px) {
    footer {
        padding: 3rem 1.2rem 2rem;
    }
    
    .footer-grid {
        gap: 2rem 1.5rem;
    }
}

/* LARGE MOBILE / SMALL TABLET (600px - 767px) */
@media (max-width: 767px) {
    footer {
        padding: 2.5rem 1rem 1.5rem;
        margin-top: 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .footer-section {
        text-align: right;
    }
    
    .footer-section h4 {
        font-size: 1.2rem;
        padding-bottom: 0.6rem;
    }
    
    .footer-section h4::after {
        width: 40px;
    }
    
    .footer-section p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .footer-section ul li {
        margin-bottom: 0.7rem;
    }
    
    .footer-section a {
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        line-height: 1.6;
        margin: 0.6rem 0;
    }
    
    .footer-bottom p:first-child {
        font-size: 0.9rem;
    }
    
    .footer-bottom p:last-child {
        font-size: 1rem;
    }
}

/* MOBILE PHONE (480px - 599px) */
@media (max-width: 599px) {
    footer {
        padding: 2rem 0.8rem 1.5rem;
    }
    
    .footer-grid {
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-section h4 {
        font-size: 1.15rem;
        margin-bottom: 0.8rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }
    
    .footer-section ul li {
        margin-bottom: 0.6rem;
    }
    
    .footer-divider {
        width: 50px;
        height: 2px;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
        margin: 0.5rem 0;
    }
    
    .footer-bottom p:first-child {
        font-size: 0.85rem;
    }
    
    .footer-bottom p:last-child {
        font-size: 0.95rem;
    }
}

/* SMALL MOBILE (360px - 479px) */
@media (max-width: 479px) {
    footer {
        padding: 1.8rem 0.6rem 1.2rem;
    }
    
    .footer-grid {
        gap: 1.8rem;
        margin-bottom: 1.8rem;
    }
    
    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
        padding-bottom: 0.5rem;
    }
    
    .footer-section h4::after {
        width: 35px;
    }
    
    .footer-section p {
        font-size: 0.8rem;
        line-height: 1.6;
    }
    
    .footer-section a {
        font-size: 0.8rem;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
    
    .footer-bottom {
        padding-top: 1.2rem;
    }
    
    .footer-bottom p {
        font-size: 0.75rem;
        line-height: 1.5;
        margin: 0.4rem 0;
    }
    
    .footer-bottom p:first-child {
        font-size: 0.8rem;
    }
    
    .footer-bottom p:last-child {
        font-size: 0.9rem;
    }
}

/* EXTRA SMALL MOBILE (< 360px) */
@media (max-width: 359px) {
    footer {
        padding: 1.5rem 0.5rem 1rem;
    }
    
    .footer-grid {
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .footer-section h4::after {
        width: 30px;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.75rem;
    }
    
    .footer-section ul li {
        margin-bottom: 0.4rem;
    }
    
    .footer-divider {
        width: 40px;
        margin: 1.5rem auto;
    }
    
    .footer-bottom {
        padding-top: 1rem;
    }
    
    .footer-bottom p {
        font-size: 0.7rem;
        margin: 0.3rem 0;
    }
    
    .footer-bottom p:first-child {
        font-size: 0.75rem;
    }
    
    .footer-bottom p:last-child {
        font-size: 0.85rem;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-section {
    animation: fadeIn 0.6s ease forwards;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }
.footer-section:nth-child(4) { animation-delay: 0.4s; }

/* ========== PRINT STYLES ========== */
@media print {
    footer {
        background: white;
        color: black;
        border-top: 2px solid #ccc;
        padding: 2rem 1rem;
    }
    
    .footer-section h4 {
        color: black;
    }
    
    .footer-section a,
    .footer-section p {
        color: black;
    }
    
    .footer-divider {
        display: none;
    }
}

/* ========== ACCESSIBILITY ========== */
.footer-section a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .footer-section a {
        text-decoration: underline;
    }
    
    .footer-section h4 {
        font-weight: 800;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .footer-section {
        animation: none;
    }
    
    .footer-section a,
    .footer-section a::before {
        transition: none;
    }
}