/**
 * Footer Styles - أنماط الفوتر الاحترافي
 * يتم التحكم بالألوان من backend/settings/appearance.php
 */

/* ========================================
   Main Footer
======================================== */
.main-footer {
    position: relative;
    color: var(--footer-text-color, #94a3b8);
    overflow: hidden;
    background-color: var(--footer-color, #0f172a);
}

/* تطبيق ألوان النصوص من data attributes */
.main-footer[data-text-color] {
    --footer-text-color: attr(data-text-color);
}

.main-footer[data-heading-color] {
    --footer-heading-color: attr(data-heading-color);
}

.main-footer[data-link-color] {
    --footer-link-color: attr(data-link-color);
}

.main-footer[data-link-hover-color] {
    --footer-link-hover-color: attr(data-link-hover-color);
}

/* تطبيق لون الفوتر من قاعدة البيانات في الوضع الليلي */
[data-theme="dark"] .main-footer,
:root:not([data-theme="light"]) .main-footer {
    background-color: var(--dark-footer-color, #0a0a0a);
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--secondary-color), transparent);
}

/* ========================================
   Footer Top
======================================== */
.footer-top {
    padding: 4rem 0 3rem;
}

.footer-container {
    max-width: var(--container-max-width, 1400px);
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-top .footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 3rem;
}

/* ========================================
   Footer Column
======================================== */
.footer-column {
    display: flex;
    flex-direction: column;
}

/* Footer About */
.footer-about {
    padding-left: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-logo img {
    height: 50px;
    width: auto;
}

.footer-logo i {
    font-size: 2rem;
}

.footer-description {
    color: var(--footer-text-color, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--footer-link-color, #cbd5e1);
    font-size: 1.1rem;
    transition: all var(--transition-normal, 0.3s ease);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.social-link.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
}

.social-link.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: white;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: transparent;
    color: white;
}

.social-link.youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: white;
}

.social-link.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
    color: white;
}

/* Footer Title */
.footer-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
    color: var(--footer-heading-color, #ffffff);
}

.footer-title span {
    color: var(--footer-heading-color, #ffffff);
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--secondary-color);
}

.footer-title i {
    color: var(--footer-heading-color, #ffffff);
    font-size: 1rem;
    opacity: 0.8;
}

/* Footer Links */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.footer-links li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--footer-link-color, #cbd5e1);
    font-size: 0.9375rem;
    transition: all var(--transition-normal, 0.3s ease);
}

.footer-links li a i {
    font-size: 0.625rem;
    color: var(--footer-link-color, #cbd5e1);
    transition: all var(--transition-normal);
}

.footer-links li a:hover {
    color: var(--footer-link-hover-color, #6366f1);
    padding-right: 0.5rem;
}

.footer-links li a:hover i {
    color: var(--footer-link-hover-color, #6366f1);
}

.footer-links li a:hover i {
    transform: translateX(-5px);
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.contact-info li i {
    width: 20px;
    font-size: 1rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.contact-info li span,
.contact-info li a {
    color: var(--footer-text-color, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.6;
    transition: color var(--transition-normal);
}

.contact-info li a:hover {
    color: var(--footer-link-hover-color, #6366f1);
}

.contact-info li i {
    color: var(--footer-link-color, #cbd5e1);
}

/* Newsletter */
.newsletter {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.newsletter h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--footer-heading-color, #ffffff);
}

.newsletter-form {
    width: 100%;
}

.newsletter-input-group {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.newsletter-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.newsletter-input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.newsletter-input-group input::placeholder {
    color: var(--text-muted);
}

.newsletter-input-group button {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.newsletter-input-group button:hover {
    filter: brightness(1.1);
}

/* ========================================
   Footer Bottom
======================================== */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    display: flex;
    align-items: center;
}

.copyright p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--footer-text-color, #94a3b8);
    font-size: 0.875rem;
}

.copyright i {
    font-size: 0.875rem;
    color: var(--footer-text-color, #94a3b8);
}

.copyright-text {
    color: var(--footer-text-color, #94a3b8);
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legal-links a {
    color: var(--footer-link-color, #cbd5e1);
    font-size: 0.875rem;
    transition: color var(--transition-normal);
}

.legal-links a:hover {
    color: var(--footer-link-hover-color, #6366f1);
}

.legal-links .separator {
    color: var(--footer-text-color, #94a3b8);
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ========================================
   Back to Top Button
======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal, 0.3s ease);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Pulse Animation */
.back-to-top::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
}

/* ========================================
   Light Mode - الوضع النهاري
======================================== */
[data-theme="light"] .main-footer {
    background-color: var(--footer-color, #904609) !important;
    color: #f8fafc;
}

[data-theme="light"] .main-footer .footer-description {
    color: #94a3b8;
}

[data-theme="light"] .main-footer .footer-title {
    color: #f8fafc;
}

[data-theme="light"] .main-footer .footer-links li a {
    color: #94a3b8;
}

[data-theme="light"] .main-footer .footer-links li a:hover {
    color: var(--primary-color);
}

[data-theme="light"] .main-footer .contact-info li span,
[data-theme="light"] .main-footer .contact-info li a {
    color: #94a3b8;
}

[data-theme="light"] .main-footer .contact-info li a:hover {
    color: var(--primary-color);
}

[data-theme="light"] .main-footer .social-link {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="light"] .main-footer .newsletter h4 {
    color: #f8fafc;
}

[data-theme="light"] .main-footer .newsletter-input-group {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .main-footer .newsletter-input-group input {
    color: #f8fafc;
}

[data-theme="light"] .main-footer .newsletter-input-group input::placeholder {
    color: #64748b;
}

[data-theme="light"] .main-footer .footer-bottom {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .main-footer .copyright p {
    color: #94a3b8;
}

[data-theme="light"] .main-footer .legal-links a {
    color: #94a3b8;
}

[data-theme="light"] .main-footer .legal-links a:hover {
    color: var(--primary-color);
}

[data-theme="light"] .main-footer .footer-logo {
    color: #f8fafc;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
    .footer-top .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    
    .footer-about {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .footer-top {
        padding: 3rem 0 2rem;
    }
    
    .footer-container {
        padding: 0 1.5rem;
    }
    
    .footer-top .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-title {
        font-size: 1rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .legal-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .footer-top {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-container {
        padding: 0 1rem;
    }
    
    .footer-logo {
        font-size: 1.25rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input-group input {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .newsletter-input-group button {
        width: 100%;
        padding: 0.875rem;
    }
}
