/* ========================================
   FOOTER - INK & STARS DESIGN
   ======================================== */
.site-footer {
    position: relative;
    background: transparent;
    overflow: hidden;
    margin-top: auto;
}

/* ========================================
   DECORATIVE TRANSITION - Smooth blend
   The stars zone blends seamlessly from
   the page background into the footer.
   ======================================== */
.footer-decoration {
    position: relative;
    height: 120px;
    background: transparent;
    overflow: visible;
}

/* Soft gradient overlay that blends page â†’ footer */
.footer-decoration::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(18, 18, 28, 0.08) 15%,
        rgba(18, 18, 28, 0.25) 35%,
        rgba(18, 18, 28, 0.50) 60%,
        rgba(18, 18, 28, 0.75) 80%,
        var(--bg-secondary) 100%
    );
    pointer-events: none;
}

/* Gold line at the very bottom of the decoration */
.footer-decoration::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-gold, #d4af37) 20%, 
        var(--accent-gold-light, #e8d5a3) 50%, 
        var(--accent-gold, #d4af37) 80%, 
        transparent 100%
    );
    opacity: 0.4;
    z-index: 1;
}

/* Floating stars animation */
.footer-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.footer-star {
    position: absolute;
    color: var(--accent-gold, #d4af37);
    opacity: 0.3;
    animation: twinkle 3s ease-in-out infinite;
}

.footer-star:nth-child(1) { left: 10%; top: 30%; animation-delay: 0s; font-size: 0.5rem; }
.footer-star:nth-child(2) { left: 25%; top: 60%; animation-delay: 0.5s; font-size: 0.375rem; }
.footer-star:nth-child(3) { left: 45%; top: 15%; animation-delay: 1s; font-size: 0.625rem; }
.footer-star:nth-child(4) { left: 65%; top: 50%; animation-delay: 1.5s; font-size: 0.5rem; }
.footer-star:nth-child(5) { left: 85%; top: 35%; animation-delay: 2s; font-size: 0.375rem; }

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ========================================
   MAIN FOOTER CONTENT
   ======================================== */
.footer-main {
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
}

/* Brand Section */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.footer-logo:hover .footer-logo-text {
    opacity: 0.8;
}

.footer-logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-gold-light, #e8d5a3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity var(--transition-fast);
}

.footer-logo .logo-version {
    display: inline-block;
    font-size: 0.5rem;
    margin-top: 0.2em;
}

.footer-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Social buttons */
.footer-social {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full, 50px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.social-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-pill.discord:hover {
    background: #5865F2;
    border-color: #5865F2;
    color: white;
}

.social-pill.kofi:hover {
    background: linear-gradient(135deg, #ff5e5b, #ff3366);
    border-color: #ff5e5b;
    color: white;
}

/* Navigation Columns */
.footer-nav h4 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-gold, #d4af37);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-nav h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-gold, #d4af37), transparent);
    opacity: 0.3;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs, 4px) 0;
    transition: all 0.2s ease;
    position: relative;
}

.footer-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent-purple-light);
    transition: width 0.2s ease;
}

.footer-nav a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.footer-nav a:hover::before {
    width: 100%;
}

.footer-nav a .fa-external-link-alt {
    font-size: 0.625rem;
    opacity: 0.5;
}

/* Disclaimer Section */
.footer-disclaimer-section {
    padding: var(--space-lg) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.footer-disclaimer-box {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold, #d4af37);
    font-size: 1.25rem;
}

.disclaimer-content {
    flex: 1;
}

.disclaimer-main {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.disclaimer-trademark {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.6;
    font-style: italic;
}

/* Copyright Section */
.footer-copyright-section {
    padding: var(--space-md) 0;
    background: var(--bg-secondary);
}

.footer-copyright-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.copyright-separator {
    opacity: 0.5;
}

.footer-copyright-inner a {
    color: var(--accent-purple-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-copyright-inner a:hover {
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE FOOTER
   ======================================== */

/* Tablet: 2 columns */
@media (max-width: 900px) {
    .footer-grid,
    [data-theme="lorcana"] .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }

    .footer-brand,
    [data-theme="lorcana"] .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-description {
        max-width: 400px;
    }

    .footer-disclaimer-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Mobile: 3 columns for nav sections */
@media (max-width: 600px) {
    .footer-decoration {
        height: 50px;
    }

    .footer-main {
        padding: var(--space-lg) 0;
    }

    /* 3 columns for nav sections */
    .footer-grid,
    [data-theme="lorcana"] .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--space-md) var(--space-xs);
        text-align: center;
    }

    /* Brand spans full width */
    .footer-brand,
    [data-theme="lorcana"] .footer-brand {
        grid-column: 1 / -1;
        gap: var(--space-sm);
        margin-bottom: var(--space-xs);
    }

    /* Hide long description */
    .footer-description {
        display: none;
    }

    .footer-logo-icon {
        width: 36px;
        height: 36px;
    }

    .footer-logo-text {
        font-size: 1.1rem;
    }

    .social-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Compact nav columns */
    .footer-nav h4 {
        font-size: 0.625rem;
        margin-bottom: var(--space-sm);
        justify-content: center;
    }

    .footer-nav h4::after {
        display: none;
    }

    .footer-nav ul {
        align-items: center;
        gap: var(--space-xs, 4px);
    }

    .footer-nav a {
        font-size: 0.8125rem;
        padding: 2px 0;
    }

    .footer-nav a:hover {
        transform: none;
    }

    /* Compact disclaimer */
    .footer-disclaimer-section {
        padding: var(--space-sm) 0;
    }

    .disclaimer-icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .disclaimer-main {
        font-size: 0.75rem;
    }

    .disclaimer-trademark {
        font-size: 0.6875rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .footer-grid,
    [data-theme="lorcana"] .footer-grid {
        gap: var(--space-sm, 8px) var(--space-xs, 4px);
    }

    .footer-nav a {
        font-size: 0.75rem;
    }

    .footer-nav h4 {
        font-size: 0.5625rem;
    }

    .social-pill span {
        display: none;
    }
}

/* ========================================
   BACK TO TOP - INK DROP DESIGN
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.5);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    padding: 0;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.ink-drop {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.ink-drop::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-purple, #7c3aed) 0%, var(--accent-purple-dark, #5b21b6) 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transition: box-shadow 0.2s ease;
    box-shadow: 
        0 4px 20px rgba(124, 58, 237, 0.4),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2),
        inset 0 4px 10px rgba(255, 255, 255, 0.1);
}
.ink-drop::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 12px;
    width: 12px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: rotate(-30deg);
}
.ink-drop i {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 1.125rem;
    transition: transform 0.2s ease;
}
.back-to-top:hover .ink-drop {
    transform: scale(1.1);
}
.back-to-top:hover .ink-drop::before {
    box-shadow: 
        0 8px 30px rgba(124, 58, 237, 0.5),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2),
        inset 0 4px 10px rgba(255, 255, 255, 0.1);
}
.back-to-top:hover .ink-drop i {
    animation: float-up 0.6s ease infinite;
}
@keyframes float-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.back-to-top:active .ink-drop {
    transform: scale(0.95);
}
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   LORCANA THEME - FOOTER OVERRIDES
   ======================================== */
[data-theme="lorcana"] .site-footer {
    background: transparent;
}

[data-theme="lorcana"] .footer-decoration {
    height: 120px;
}

[data-theme="lorcana"] .footer-decoration::after {
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(55, 59, 112, 0.08) 20%,
        rgba(55, 59, 112, 0.25) 45%,
        rgba(55, 59, 112, 0.45) 70%,
        rgba(55, 59, 112, 0.65) 100%
    );
}

[data-theme="lorcana"] .footer-main {
    background: linear-gradient(180deg,
        rgba(55, 59, 112, 0.65) 0%,
        rgba(55, 59, 112, 0.8) 100%);
}

[data-theme="lorcana"] .footer-disclaimer-section {
    background: rgba(55, 59, 112, 0.8);
    border-top-color: rgba(211, 186, 132, 0.15);
    border-bottom-color: rgba(211, 186, 132, 0.15);
}

[data-theme="lorcana"] .footer-copyright-section {
    background: rgba(55, 59, 112, 0.85);
}

/* Smooth transition from page bg into footer */
[data-theme="lorcana"] .footer-decoration {
    background: transparent;
}

[data-theme="lorcana"] .footer-decoration::after {
    background: linear-gradient(180deg, 
        transparent 0%,
        transparent 20%,
        rgba(55, 59, 112, 0.6) 100%
    );
}

[data-theme="lorcana"] .footer-decoration::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--illuminary-gold, #D3BA84) 20%, 
        var(--illuminary-gold-light, #E8D5A3) 50%, 
        var(--illuminary-gold, #D3BA84) 80%, 
        transparent 100%
    );
    opacity: 0.5;
}

[data-theme="lorcana"] .footer-star {
    color: var(--illuminary-gold, #D3BA84);
}

/* Grid override for Lorcana */
[data-theme="lorcana"] .footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
}

@media (max-width: 900px) {
    [data-theme="lorcana"] .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    [data-theme="lorcana"] .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    [data-theme="lorcana"] .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    [data-theme="lorcana"] .footer-brand {
        grid-column: 1 / -1;
    }
}

[data-theme="lorcana"] .footer-logo-text {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-gold, #d4af37));
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="lorcana"] .social-pill:hover {
    background: var(--accent-gold, #d4af37);
    border-color: var(--accent-gold, #d4af37);
    color: var(--bg-primary);
}

[data-theme="lorcana"] .social-pill.discord:hover {
    background: #5865F2;
    border-color: #5865F2;
    color: white;
}

[data-theme="lorcana"] .footer-nav a:hover {
    color: var(--accent-gold-light, #e8d5a3);
}

[data-theme="lorcana"] .footer-nav a::before {
    background: var(--accent-gold, #d4af37);
}

[data-theme="lorcana"] .ink-drop::before {
    background: linear-gradient(135deg, var(--accent-gold, #D3BA84) 0%, #b8943c 100%);
    box-shadow: 
        0 4px 20px rgba(211, 186, 132, 0.4),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2),
        inset 0 4px 10px rgba(255, 255, 255, 0.2);
}

[data-theme="lorcana"] .back-to-top:hover .ink-drop::before {
    box-shadow: 
        0 8px 30px rgba(211, 186, 132, 0.5),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2),
        inset 0 4px 10px rgba(255, 255, 255, 0.2);
}

[data-theme="lorcana"] .ink-drop i {
    color: var(--bg-primary);
}

[data-theme="lorcana"] .footer-copyright-inner a {
    color: var(--accent-gold, #d4af37);
}