/**
 * Foxtale Community Portal - Main Styles
 * Version: 1.0.1
 */

/* ========================================
   CSS Variables
======================================== */
:root {
    --fox-rust: #8a2c04;
    --fox-rust-light: #c44d0a;
    --fox-teal: #1a2e2e;
    --fox-cream: #faf8f5;
    --fox-text: #1a1a1a;
    --fox-text-muted: #6b6b6b;
    --glass-bg: rgba(255,255,255,0.45);
    --glass-border: rgba(255,255,255,0.6);
    --font-display: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Reset & Base
======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--fox-cream);
    color: var(--fox-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Background Effects
======================================== */
.fx-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.fx-bg::before {
    content: '';
    position: absolute;
    width: 150vmax;
    height: 150vmax;
    top: -75vmax;
    left: -25vmax;
    background: conic-gradient(from 180deg, var(--fox-cream) 0deg, #f5e6d3 90deg, var(--fox-cream) 180deg, #e8d5c4 270deg, var(--fox-cream) 360deg);
    animation: rotate 60s linear infinite;
}

.fx-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.fx-blob-1 {
    width: 500px;
    height: 500px;
    background: rgba(138,44,4,0.2);
    top: -150px;
    right: -150px;
}

.fx-blob-2 {
    width: 400px;
    height: 400px;
    background: rgba(26,46,46,0.15);
    bottom: -100px;
    left: -100px;
    animation-delay: -10s;
}

.fx-blob-3 {
    width: 300px;
    height: 300px;
    background: rgba(138,44,4,0.15);
    top: 50%;
    left: 30%;
    animation-delay: -5s;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* ========================================
   Glass Effect
======================================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.glass-dark {
    background: rgba(26,46,46,0.9);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ========================================
   Header - Light (Default)
======================================== */
.fx-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 32px;
}

.fx-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    border-radius: 16px;
}

.fx-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fx-header-left > a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.fx-header-logo {
    width: 168px;
    height: auto;
}

/* ========================================
   Header - Dark (Community Page)
======================================== */
.fx-header--dark .fx-header-inner {
    background: rgba(26, 46, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fx-header--dark .fx-nav-link {
    color: rgba(255,255,255,0.8);
}

.fx-header--dark .fx-nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.15);
}

.fx-header--dark .fx-nav-link.active {
    color: white;
    background: rgba(255,255,255,0.2);
}

.fx-header--dark .fx-user-badge {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* ========================================
   Navigation
======================================== */
.fx-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 32px;
}

.fx-nav-link {
    position: relative;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fox-text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.fx-nav-link:hover {
    color: var(--fox-text);
    background: rgba(0,0,0,0.04);
}

.fx-nav-link.active {
    color: var(--fox-rust);
    background: rgba(138,44,4,0.08);
}

/* ========================================
   Header Right
======================================== */
.fx-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fx-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(138, 44, 4, 0.1);
    border-radius: 100px;
    font-size: 13px;
    color: var(--fox-rust);
}

/* ========================================
   Buttons
======================================== */
.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.fx-btn-primary {
    background: linear-gradient(135deg, var(--fox-rust), var(--fox-rust-light));
    color: white;
    box-shadow: 0 4px 16px rgba(138,44,4,0.3);
}

.fx-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138,44,4,0.4);
}

.fx-btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--fox-text);
}

.fx-btn-glass:hover {
    background: rgba(255,255,255,0.6);
}

/* Meeting Button Variants */
.fx-btn-zoom {
    background: linear-gradient(135deg, #2D8CFF, #0B5CFF);
    color: white;
    box-shadow: 0 4px 16px rgba(45,140,255,0.3);
}

.fx-btn-zoom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,140,255,0.4);
}

.fx-btn-meet {
    background: linear-gradient(135deg, #00897B, #00695C);
    color: white;
    box-shadow: 0 4px 16px rgba(0,137,123,0.3);
}

.fx-btn-meet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,137,123,0.4);
}

.fx-btn-teams {
    background: linear-gradient(135deg, #5B5FC7, #464EB8);
    color: white;
    box-shadow: 0 4px 16px rgba(91,95,199,0.3);
}

.fx-btn-teams:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91,95,199,0.4);
}

/* ========================================
   Mobile Menu
======================================== */
.fx-mobile-menu-btn {
    display: none !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: rgba(138,44,4,0.1);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fx-mobile-menu-btn:hover {
    background: rgba(138,44,4,0.15);
}

.fx-mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: var(--fox-rust);
}

.fx-header--dark .fx-mobile-menu-btn {
    background: rgba(255,255,255,0.15);
}

.fx-header--dark .fx-mobile-menu-btn:hover {
    background: rgba(255,255,255,0.25);
}

.fx-header--dark .fx-mobile-menu-btn svg {
    color: white;
}

.fx-mobile-nav {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fx-mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.fx-mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.fx-mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--fox-teal);
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.fx-mobile-nav.active .fx-mobile-nav-panel {
    transform: translateX(0);
}

.fx-mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.fx-mobile-nav-header img {
    width: 120px;
}

.fx-mobile-nav-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fx-mobile-nav-close:hover {
    background: rgba(255,255,255,0.2);
}

.fx-mobile-nav-close svg {
    width: 20px;
    height: 20px;
    color: white;
}

.fx-mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.fx-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.fx-mobile-nav-link:hover,
.fx-mobile-nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.fx-mobile-nav-link span {
    font-size: 20px;
}

.fx-mobile-nav-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.fx-mobile-nav-footer .fx-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
}

.fx-mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    margin-bottom: 12px;
    color: white;
    font-size: 15px;
}

.fx-mobile-nav-user span {
    font-size: 20px;
}

@media (max-width: 1024px) {
    .fx-mobile-menu-btn {
        display: flex !important;
    }
    
    .fx-mobile-nav {
        display: block !important;
    }
    
    .fx-nav {
        display: none;
    }
    
    .fx-header-right .fx-btn,
    .fx-header-right .fx-user-badge {
        display: none !important;
    }
}

/* ========================================
   Page Header
======================================== */
.fx-page-header {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 32px 40px;
    text-align: center;
}

.fx-page-header h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 500;
    color: var(--fox-text);
    margin-bottom: 12px;
}

.fx-page-header p {
    font-size: 18px;
    color: var(--fox-text-muted);
}

/* ========================================
   Hero Section (Community Page)
======================================== */
.fx-hero {
    text-align: center;
    padding: 100px 40px 120px;
}

.fx-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 24px;
}

.fx-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 500;
    color: white;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.fx-hero h1 em {
    font-style: italic;
    color: rgba(255,255,255,0.9);
}

.fx-hero p {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   Main Content
======================================== */
.fx-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px 60px;
}

/* ========================================
   Cards
======================================== */
.fx-card {
    padding: 40px 50px 40px 40px;
    margin-bottom: 24px;
    border-left: 5px solid var(--fox-rust);
    transition: all 0.4s var(--ease-out-expo);
}

.fx-card:hover {
    transform: translateX(8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.fx-card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fox-text-muted);
    margin-bottom: 12px;
}

.fx-card-date svg {
    width: 16px;
    height: 16px;
}

.fx-card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    color: var(--fox-text);
    margin-bottom: 16px;
    line-height: 1.3;
}

.fx-card .content {
    font-size: 16px;
    color: var(--fox-text-muted);
    line-height: 1.7;
}

.fx-card .content p {
    margin-bottom: 16px;
}

.fx-card .content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Loader
======================================== */
.fx-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.fx-loader-icon {
    width: 60px;
    height: auto;
    object-fit: contain;
    animation: foxPulse 1.5s ease-in-out infinite;
}

.fx-loader-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--fox-text-muted);
}

@keyframes foxPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* ========================================
   Empty State
======================================== */
.fx-empty {
    text-align: center;
    padding: 80px 40px;
}

.fx-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.fx-empty h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--fox-text);
    margin-bottom: 10px;
}

.fx-empty p {
    color: var(--fox-text-muted);
}

/* ========================================
   Pagination
======================================== */
.fx-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.fx-pagination a,
.fx-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fx-pagination a {
    background: white;
    color: var(--fox-text);
    border: 1px solid rgba(0,0,0,0.1);
}

.fx-pagination a:hover {
    background: var(--fox-rust);
    color: white;
    border-color: var(--fox-rust);
}

.fx-pagination .current {
    background: var(--fox-rust);
    color: white;
}

/* ========================================
   Footer
======================================== */
.fx-footer {
    background: var(--fox-teal);
    padding: 60px 40px 30px;
    margin-top: 60px;
}

.fx-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.fx-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.fx-footer-logo {
    flex-shrink: 0;
}

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

.fx-footer-social {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.fx-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fx-footer-social a:hover {
    background: var(--fox-rust);
    transform: translateY(-2px);
}

.fx-footer-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.fx-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.fx-footer-copyright {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.fx-footer-copyright a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}

.fx-footer-copyright a:hover {
    color: white;
}

.fx-footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.fx-footer-links a {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.fx-footer-links a:hover {
    color: white;
}

.fx-footer-credit {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.fx-footer-credit a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.fx-footer-credit a:hover {
    color: #c44d0a;
}

/* ========================================
   Responsive - Mobile
======================================== */
@media (max-width: 768px) {
    .fx-header {
        padding: 10px 16px;
    }
    
    .fx-header-inner {
        padding: 10px 14px;
    }
    
    .fx-header-logo {
        width: 120px;
    }
    
    .fx-page-header {
        padding: 40px 20px 30px;
    }
    
    .fx-page-header h1 {
        font-size: 32px;
    }
    
    .fx-hero {
        padding: 60px 20px 80px;
    }
    
    .fx-hero h1 {
        font-size: 36px;
    }
    
    .fx-main {
        padding: 0 16px 40px;
    }
    
    .fx-card {
        padding: 24px;
    }
    
    .fx-card h2 {
        font-size: 20px;
    }
    
    .fx-footer {
        padding: 40px 20px 24px;
    }
    
    .fx-footer-top {
        flex-direction: column;
        gap: 30px;
    }
    
    .fx-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .fx-footer-links {
        justify-content: center;
    }
    
    .fx-user-badge {
        display: none;
    }
}

/* ========================================
   User Menu Dropdown
======================================== */
.fx-user-menu {
    position: relative;
}

.fx-user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    color: inherit;
    font-family: var(--font-body);
}

.fx-user-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.fx-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.fx-user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fox-rust) 0%, var(--fox-rust-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.fx-user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.fx-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fx-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fox-text);
    transition: all 0.2s;
}

.fx-dropdown-item:hover {
    background: var(--fox-cream);
}

.fx-dropdown-item svg {
    color: var(--fox-text-muted);
}

.fx-dropdown-logout {
    color: #dc2626;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 4px;
    padding-top: 12px;
}

.fx-dropdown-logout svg {
    color: #dc2626;
}

/* Mobile nav profile */
.fx-mobile-nav-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.fx-mobile-nav-profile:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fx-mobile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.fx-mobile-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fox-rust) 0%, var(--fox-rust-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.fx-mobile-nav-profile div {
    display: flex;
    flex-direction: column;
}

.fx-mobile-nav-profile strong {
    font-size: 15px;
    color: white;
}

.fx-mobile-nav-profile span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
    .fx-user-name {
        display: none;
    }
    
    .fx-user-toggle svg:last-child {
        display: none;
    }
    
    .fx-user-toggle {
        padding: 6px;
    }
}
