/* 
 * Potkasts Public Layout
 * Footer, flash messages, and layout-specific styles
 */

/* ===== LAYOUT SPACING ===== */

/* Add padding to body for fixed navbar */
body {
    padding-top: 80px; /* Height of navbar */
    padding-bottom: 100px; /* Height of potential player */
}

/* Ensure main content has proper spacing */
main {
    min-height: calc(100vh - 180px); /* Viewport minus navbar and footer */
}

/* ===== FLASH MESSAGES ===== */

.flash-messages {
    position: fixed;
    top: 100px; /* Below navbar */
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.flash-message {
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-primary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px var(--color-shadow-default);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    animation: slideInFlash 0.3s ease-out forwards;
}

@keyframes slideInFlash {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.flash-message i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 2px;
}

.flash-message span {
    flex: 1;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.flash-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.flash-close:hover {
    color: var(--color-text-primary);
}

/* Flash message variants */
.flash-success {
    border-left: 4px solid var(--color-success);
}

.flash-success i {
    color: var(--color-success);
}

.flash-warning {
    border-left: 4px solid var(--color-warning);
}

.flash-warning i {
    color: var(--color-warning);
}

.flash-error {
    border-left: 4px solid var(--color-danger);
}

.flash-error i {
    color: var(--color-danger);
}

.flash-info {
    border-left: 4px solid var(--color-info);
}

.flash-info i {
    color: var(--color-info);
}

/* ===== FOOTER ===== */

.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border-muted);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-title {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-title i {
    color: var(--color-brand-primary);
}

.footer-subtitle {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.footer-description {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: 1rem;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0;
}

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

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-muted);
    border-radius: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

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

.footer-bottom {
    border-top: 1px solid var(--color-border-muted);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.footer-version {
    font-family: 'Courier New', monospace;
    background: var(--color-bg-glass);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--color-border-muted);
}

/* ===== RESPONSIVE LAYOUT ===== */

@media (max-width: 768px) {
    body {
        padding-top: 70px; /* Smaller navbar on mobile */
    }
    
    .flash-messages {
        top: 80px;
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .flash-messages {
        top: 70px;
        left: 10px;
        right: 10px;
    }
    
    .flash-message {
        padding: 0.75rem;
    }
    
    .footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-social-link {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ===== SKIP LINKS ===== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-brand-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s ease;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus indicators */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border-primary: rgba(255, 255, 255, 0.5);
        --color-border-muted: rgba(255, 255, 255, 0.3);
        --color-text-muted: #b0b0b0;
    }
}

/* Dark mode is default, but support for light mode preference */
@media (prefers-color-scheme: light) {
    /* User prefers light mode, but we maintain dark theme for brand consistency */
    /* This is intentionally empty as we use dark theme by design */
}

/* ===== SCROLL BEHAVIOR ===== */

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-brand-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-brand-purple-light);
}

/* ===== LOADING STATES ===== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border-muted);
    border-top: 3px solid var(--color-brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    text-align: center;
}

/* ===== PRINT STYLES ===== */

@media print {
    /* Hide unnecessary elements when printing */
    .navbar,
    .footer,
    .podcast-player,
    .flash-messages,
    .skip-link {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
        background: white !important;
        color: black !important;
    }
    
    main {
        min-height: auto !important;
    }
    
    /* Ensure links show their URLs when printed */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}