/* ==========================================================================
   Footer Styles
   WalchandPRO — Enterprise Learning Platform
   ========================================================================== */

.site-footer {
    background-color: var(--bg-navbar);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 48px 24px 24px;
}

@media (min-width: 1024px) {
    .footer-container {
        max-width: 1400px;
        padding: 48px 32px 24px;
    }
}

/* Main Section: Unified 4-Column Grid */
.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 1.5fr repeat(3, 1fr);
        gap: 48px;
    }
}

@media (min-width: 1024px) {
    .footer-main {
        gap: 64px;
    }
}

/* Brand Section */
.footer-brand {
    max-width: 320px;
}

@media (max-width: 767px) {
    .footer-brand {
        max-width: 100%;
    }
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 16px;
}

.footer-logo-img {
    height: 28px;
    width: auto;
}

[data-theme="dark"] .footer-logo-img {
    filter: brightness(0) invert(1);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Social Icons */
.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.footer-social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

[data-theme="dark"] .footer-social-link:hover {
    background: #60a5fa;
}

.footer-social-link svg {
    width: 16px;
    height: 16px;
}

/* Footer Columns - Now part of the main grid */
.footer-links-grid {
    display: contents;
}

.footer-column {
    text-align: left;
}

@media (max-width: 767px) {
    .footer-links-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 24px;
    }
}

.footer-column-title {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li:last-child {
    margin-bottom: 0;
}

.footer-links a {
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: var(--link-underline);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a:hover::after {
    transform: scaleX(1);
}

[data-theme="dark"] .footer-links a:hover {
    color: #60a5fa;
}

/* Categories Row */
.footer-categories {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.footer-categories-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-categories-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-categories-list a {
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 4px 8px;
}

.footer-categories-list a::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    background-color: var(--link-underline);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-categories-list a:hover {
    color: var(--primary);
}

.footer-categories-list a:hover::after {
    transform: scaleX(1);
}

[data-theme="dark"] .footer-categories-list a:hover {
    color: #60a5fa;
}

.footer-categories-divider {
    color: var(--border-color);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-categories-list {
        gap: 4px;
    }

    .footer-categories-divider {
        display: none;
    }

    .footer-categories-list a {
        padding: 6px 12px;
        background: var(--bg-hover);
        border-radius: 6px;
        margin: 4px;
    }
}

/* Bottom Bar */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-made-with {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-made-with a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.footer-made-with a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background-color: var(--text-secondary);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-made-with a:hover::after {
    transform: scaleX(1);
}

[data-theme="dark"] .footer-made-with a {
    color: var(--text-secondary);
}

.footer-coffee {
    display: inline-block;
    vertical-align: -3px;
    color: var(--text-secondary);
    margin: 0 3px;
}

[data-theme="dark"] .footer-coffee {
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(21, 79, 149, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(21, 79, 149, 0.4);
}

.scroll-to-top.visible:hover {
    transform: translateY(-2px);
}

[data-theme="dark"] .scroll-to-top {
    background: #60a5fa;
    box-shadow: 0 4px 12px rgba(50, 148, 227, 0.3);
}

[data-theme="dark"] .scroll-to-top:hover {
    background: #3b82f6;
    box-shadow: 0 6px 16px rgba(50, 148, 227, 0.4);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}
