/* ================================================
   Giornale Scolastico Cesaris 2.0
   Main Stylesheet
   ================================================ */

/* ================================================
   CSS VARIABLES - Cesaris Theme
   ================================================ */
:root {
    /* Cesaris Color Palette */
    --primary: #0033A0;       /* Blu Scuro Cesaris */
    --secondary: #FFD700;     /* Giallo Accento */
    --success: #10B981;       /* Verde menta */
    --neutral: #6B7280;       /* Grigio freddo */
    --bg-light: #F9FAFB;      /* Bianco quasi puro */
    --bg-card: #FFFFFF;       /* Bianco puro */
    --text-dark: #1F2937;     /* Grigio carbone */
    --error: #DC2626;         /* Rosso */
    
    /* Neon Accents */
    --neon-blue: #00f0ff;
    --neon-purple: #b026ff;
    --neon-pink: #ff2d95;
    --neon-green: #39ff14;
    --neon-glow-blue: 0 0 10px #00f0ff, 0 0 20px #00f0ff, 0 0 40px #00f0ff;
    --neon-glow-purple: 0 0 10px #b026ff, 0 0 20px #b026ff, 0 0 40px #b026ff;
    --neon-glow-pink: 0 0 10px #ff2d95, 0 0 20px #ff2d95, 0 0 40px #ff2d95;
    
    /* Typography */
    --font-heading: Georgia, Garamond, serif;
    --font-body: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-loader: 9999;
}

/* ================================================
   PAGE LOADER (Global Loading Screen)
   ================================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loader);
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--neutral);
    font-weight: 500;
}

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

/* ================================================
   RESET & BASE STYLES
   ================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

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

/* ================================================
   LAYOUT COMPONENTS
   ================================================ */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* ================================================
   HEADER & NAVIGATION
   ================================================ */
.header {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary);
    color: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #002880;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: #ffd000;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-danger {
    background-color: var(--error);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.card-text {
    color: var(--neutral);
    margin-bottom: var(--spacing-md);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--neutral);
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.hero-mobile {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: var(--spacing-xl);
    color: white;
}

.hero-title {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.hero-meta {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

/* ================================================
   ARTICLE GRID
   ================================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.article-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.article-card-mini {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
}

.article-card-mini img {
    height: 60%;
    object-fit: cover;
}

.article-card-mini .card-body {
    padding: var(--spacing-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card-mini .card-title {
    font-size: 0.875rem;
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
}

.article-card-mini .card-meta {
    font-size: 0.75rem;
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-2xl) 0;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--neutral);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.page-num:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

.page-num.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ================================================
   FORMS
   ================================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-card);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ================================================
   CHAT BUBBLE (Sticky)
   ================================================ */
.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.chat-bubble:hover {
    transform: scale(1.1);
}

/* ================================================
   NEWSLETTER WIDGET
   ================================================ */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary), #0044cc);
    color: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    text-align: center;
    margin: var(--spacing-2xl) 0;
}

.newsletter-widget h4 {
    color: white;
    margin-bottom: var(--spacing-lg);
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
}

.newsletter-form button {
    padding: var(--spacing-md) var(--spacing-xl);
    background-color: var(--secondary);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background-color: #ffd000;
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
    background-color: var(--text-dark);
    color: white;
    padding: var(--spacing-2xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.footer-section h4 {
    color: var(--secondary);
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: white;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* ================================================
   UTILITY CLASSES
   ================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */
@media (max-width: 768px) {
    /* Mobile adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .header-content {
        padding: var(--spacing-sm) 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* Note: Mobile nav menu styling is handled below in the complete mobile responsive section */
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .hero {
        height: 300px;
    }
    
    .hero-mobile {
        height: 250px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet adjustments */
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* ================================================
   NEON EFFECTS & ENHANCEMENTS
   ================================================ */

/* Neon glow animation */
@keyframes neonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px var(--neon-blue)) drop-shadow(0 0 10px var(--neon-blue));
    }
    50% {
        filter: drop-shadow(0 0 10px var(--neon-blue)) drop-shadow(0 0 20px var(--neon-blue)) drop-shadow(0 0 30px var(--neon-blue));
    }
}

@keyframes neonBorderPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--neon-blue), inset 0 0 5px rgba(0, 240, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 15px var(--neon-blue), 0 0 25px rgba(0, 240, 255, 0.3), inset 0 0 10px rgba(0, 240, 255, 0.2);
    }
}

/* Neon Header Accent */
.header {
    border-bottom: 2px solid transparent;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)), 
                      linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Neon Logo Effect */
.logo:hover {
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    transition: text-shadow 0.3s ease;
}

/* Neon Navigation Links */
.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, var(--primary), #0044cc);
    box-shadow: 0 0 10px rgba(0, 51, 160, 0.5), 0 0 20px rgba(0, 51, 160, 0.3);
}

/* Neon Button Effects */
.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--primary), #0044cc);
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--neon-blue), 0 0 30px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

/* Neon Card Effects */
.card:hover,
.article-card:hover {
    box-shadow: var(--shadow-xl), 0 0 20px rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

/* Neon Chat Bubble */
.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(0, 240, 255, 0.4);
    transition: var(--transition);
    animation: neonPulse 2s ease-in-out infinite;
}

.chat-bubble:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-xl), 0 0 30px var(--neon-blue), 0 0 50px rgba(0, 240, 255, 0.5);
}

/* Neon Input Focus */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.chat-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.2), 0 0 15px rgba(0, 240, 255, 0.3);
}

/* Neon Toggle Switch */
.toggle-switch.active {
    background: linear-gradient(135deg, var(--success), #0ee);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Neon Badge */
.badge-primary,
.badge.badge-primary {
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Neon Footer */
.footer {
    background: linear-gradient(180deg, var(--text-dark), #0a0a0a);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--neon-pink), var(--neon-blue));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Neon Section Headers */
.settings-section h2,
.profile-main h2,
.profile-main h3 {
    position: relative;
    display: inline-block;
}

.settings-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border-radius: 2px;
}

/* Neon Alert Enhancements */
.alert-success {
    border-left: 4px solid var(--neon-green);
    box-shadow: -3px 0 10px rgba(57, 255, 20, 0.3);
}

.alert-error {
    border-left: 4px solid var(--neon-pink);
    box-shadow: -3px 0 10px rgba(255, 45, 149, 0.3);
}

/* Neon Pagination */
.page-num.active {
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.page-num:hover:not(.active) {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Neon Mention Highlight in Chat */
.mention {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(176, 38, 255, 0.2));
    color: var(--neon-blue);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

/* Neon Hover States for Links */
a:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

/* Neon Profile Avatar */
.profile-avatar {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 0 20px rgba(0, 240, 255, 0.2);
}

/* Neon Achievement Badges */
.achievement-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    transition: var(--transition);
}

.achievement-badge:hover {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

/* Neon Stats Cards */
.stat-card {
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.stat-number {
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Neon Daily Quote */
#dailyQuote {
    position: relative;
    padding: 1rem;
}

#dailyQuote::before,
#dailyQuote::after {
    content: '"';
    font-size: 3rem;
    color: var(--neon-blue);
    opacity: 0.3;
    position: absolute;
}

#dailyQuote::before {
    top: -10px;
    left: 0;
}

#dailyQuote::after {
    bottom: -30px;
    right: 0;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile Navigation Toggle */
.menu-toggle,
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    /* Mobile Menu Toggle Visible */
    .menu-toggle,
    .mobile-menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }
    
    /* Mobile navigation slide-in menu */
    nav ul,
    nav .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 4rem 1rem 2rem;
        transition: right 0.3s ease;
        z-index: 1000;
        display: flex !important;
        list-style: none;
        gap: 0.5rem;
    }
    
    nav ul.mobile-menu-open,
    nav .nav-menu.mobile-menu-open {
        right: 0;
    }
    
    nav ul li,
    nav .nav-menu li {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    nav ul li a,
    nav .nav-menu li a {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    nav ul li a:hover,
    nav .nav-menu li a:hover {
        background: var(--bg-light);
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Grids become single column */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Article cards */
    .article-card {
        margin-bottom: 1rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin: 0.25rem 0;
    }
    
    /* Tables scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Article detail page */
    .article-container {
        padding: 0 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-image {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: cover;
    }
    
    /* Reaction buttons */
    .reactions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .reaction-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 80px;
    }
    
    /* Chat interface */
    .chat-container {
        height: calc(100vh - 120px);
    }
    
    .chat-messages {
        padding: 0.5rem;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Settings page */
    .settings-section {
        padding: 1rem;
    }
    
    /* Profile page */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-bottom: 1rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-btn {
        min-width: 40px;
        padding: 0.5rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    /* Touch targets - minimum 44px */
    a, button, input, select, textarea {
        min-height: 44px;
    }
    
    /* Prevent text size adjust */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Hero section */
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    /* Navigation tabs */
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .nav-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }
    
    .article-title {
        font-size: 1.25rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

/* ================================================
   GAMIFICATION SYSTEM - Points, Badges, Achievements
   ================================================ */

/* User Level Badge */
.user-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), #0052cc);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 51, 160, 0.3);
}

.user-level-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #B87333);
}

.user-level-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.user-level-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.user-level-badge.platinum {
    background: linear-gradient(135deg, #E5E4E2, #B4B4B4);
}

.user-level-badge.diamond {
    background: linear-gradient(135deg, #B9F2FF, #00CED1);
    color: #333;
    animation: diamondShine 3s ease-in-out infinite;
}

@keyframes diamondShine {
    0%, 100% { box-shadow: 0 0 5px #00CED1; }
    50% { box-shadow: 0 0 20px #00CED1, 0 0 30px #B9F2FF; }
}

/* Points Display */
.points-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: #92400e;
    border: 2px solid #fcd34d;
}

.points-display .icon {
    font-size: 1.25rem;
}

.points-display .value {
    font-size: 1rem;
}

.points-gained {
    animation: pointsPopup 0.5s ease-out;
    color: #16a34a;
    font-weight: 600;
}

@keyframes pointsPopup {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    50% { transform: translateY(-5px) scale(1.1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Achievement Badge */
.achievement-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-card), #e5e7eb);
    border: 3px solid #e5e7eb;
    font-size: 1.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.achievement-badge.unlocked {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fcd34d;
    box-shadow: 0 0 15px rgba(252, 211, 77, 0.5);
}

.achievement-badge.unlocked:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(252, 211, 77, 0.7);
}

.achievement-badge.locked {
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement-badge .checkmark {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--neon-blue));
    transition: width 0.5s ease;
}

.progress-bar-fill.animated {
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* XP Progress */
.xp-progress {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.xp-level {
    font-weight: 700;
    color: var(--primary);
}

.xp-values {
    font-size: 0.85rem;
    color: var(--neutral);
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.leaderboard-header {
    background: linear-gradient(135deg, var(--primary), #0052cc);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

.leaderboard-item:hover {
    background: var(--bg-light);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(0, 51, 160, 0.05), rgba(0, 240, 255, 0.05));
    border-left: 3px solid var(--primary);
}

.leaderboard-rank {
    font-size: 1.25rem;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.leaderboard-rank.gold { color: #FFD700; }
.leaderboard-rank.silver { color: #C0C0C0; }
.leaderboard-rank.bronze { color: #CD7F32; }

.leaderboard-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-dark);
}

.leaderboard-stats {
    font-size: 0.85rem;
    color: var(--neutral);
}

.leaderboard-points {
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Daily Streak */
.daily-streak {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius-lg);
    border: 2px solid #fcd34d;
}

.streak-flame {
    font-size: 2rem;
    animation: flameDance 0.5s ease-in-out infinite alternate;
}

@keyframes flameDance {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.1) rotate(5deg); }
}

.streak-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #92400e;
}

.streak-days {
    font-size: 0.85rem;
    color: #b45309;
}

/* Challenge Card */
.challenge-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-md);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.challenge-title {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.challenge-reward {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #16a34a;
    font-weight: 600;
}

.challenge-description {
    font-size: 0.9rem;
    color: var(--neutral);
    margin-bottom: 1rem;
}

.challenge-progress {
    font-size: 0.85rem;
    color: var(--neutral);
    margin-top: 0.5rem;
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    animation: bellPulse 2s ease-in-out infinite;
}

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

/* Social Stats */
.social-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.social-stat {
    text-align: center;
    flex: 1;
}

.social-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.social-stat-label {
    font-size: 0.8rem;
    color: var(--neutral);
}

/* Quick Actions Floating Button */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 51, 160, 0.4);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 51, 160, 0.5);
}

/* Interactive Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

/* Pulse Animation for CTA */
.pulse {
    animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoad 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonLoad {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-dark);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.tooltip:hover::after {
    opacity: 1;
    bottom: calc(100% + 5px);
}

/* Fun Stickers/Emotes for chat */
.sticker {
    display: inline-block;
    font-size: 3rem;
    animation: stickerBounce 0.5s ease;
}

@keyframes stickerBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Cool gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated border */
.animated-border {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.animated-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--neon-blue), var(--neon-purple), var(--neon-pink), var(--primary));
    background-size: 400% 400%;
    animation: borderGradient 3s linear infinite;
    z-index: -1;
    border-radius: inherit;
}

@keyframes borderGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Shake animation for errors */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Bounce animation */
.bounce {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Slide animations */
.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scale up animation */
.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ================================================
   QUALITY OF LIFE FEATURES CSS
   ================================================ */

/* QoL Modal Base */
.qol-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 1rem;
}

.qol-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.qol-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quick Search Modal */
.qol-search-modal {
    overflow: hidden;
}

.qol-search-modal input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    outline: none;
}

.qol-search-modal input::placeholder {
    color: #9ca3af;
}

.qol-search-results {
    max-height: 300px;
    overflow-y: auto;
}

.qol-search-hint {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.qol-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s;
}

.qol-search-item:hover,
.qol-search-item.selected {
    background: #f3f4f6;
}

.qol-search-item .icon {
    font-size: 1.5rem;
}

.qol-search-footer {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

/* Keyboard Shortcuts Modal */
.qol-shortcuts-modal {
    padding: 2rem;
}

.qol-shortcuts-modal h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.shortcuts-grid {
    display: grid;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.shortcut-item span:last-child {
    color: #6b7280;
}

/* Toast Notifications */
.qol-toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qol-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: toastSlideIn 0.3s ease;
    min-width: 250px;
}

.qol-toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

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

@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(100%); }
}

.qol-toast-success { border-left: 4px solid #10b981; }
.qol-toast-error { border-left: 4px solid #ef4444; }
.qol-toast-warning { border-left: 4px solid #f59e0b; }
.qol-toast-info { border-left: 4px solid #3b82f6; }

.toast-icon { font-size: 1.25rem; }
.toast-message { flex: 1; font-size: 0.9rem; }
.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Back to Top Button */
.qol-back-to-top {
    position: fixed;
    bottom: 90px;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(0,51,160,0.3);
}

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

.qol-back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,51,160,0.4);
}

/* Reading Progress Bar */
.qol-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--neon-blue));
    width: 0%;
    z-index: 9999;
    transition: width 0.1s;
}

/* Quick Actions FAB */
.qol-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.qol-fab .fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,51,160,0.4);
    transition: all 0.3s ease;
}

.qol-fab .fab-main:hover {
    transform: scale(1.1) rotate(15deg);
}

.qol-fab .fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.qol-fab .fab-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qol-fab .fab-menu button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.qol-fab .fab-menu button:hover {
    transform: scale(1.1);
}

/* Text Selection Popup */
.qol-selection-popup {
    position: absolute;
    display: flex;
    gap: 0.5rem;
    background: var(--text-dark);
    padding: 0.5rem;
    border-radius: 8px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.qol-selection-popup button {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.qol-selection-popup button:hover {
    background: rgba(255,255,255,0.2);
}

/* Share Modal */
.qol-share-modal {
    padding: 2rem;
    text-align: center;
}

.qol-share-modal h3 {
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.whatsapp {
    background: #25D366;
    color: white;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.share-btn.copy {
    background: #f3f4f6;
    color: var(--text-dark);
}

/* Confetti */
.qol-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Notification Bell */
.qol-notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
}

.qol-notification-bell .bell-icon {
    font-size: 1.25rem;
}

.qol-notification-bell .bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

/* Tab Hidden - Pause animations */
.tab-hidden * {
    animation-play-state: paused !important;
}

/* Print Styles */
@media print {
    .qol-fab,
    .qol-back-to-top,
    .qol-notification-bell,
    .chat-bubble,
    .header,
    .footer,
    nav {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* Responsive QoL Features */
@media (max-width: 768px) {
    .qol-toast-container {
        left: 1rem;
        right: 1rem;
    }
    
    .qol-toast {
        min-width: auto;
    }
    
    .qol-search-footer {
        display: none;
    }
    
    /* Hide chat bubble on mobile since FAB has chat option */
    .chat-bubble {
        display: none !important;
    }
    
    .qol-fab {
        bottom: 80px;
    }
    
    .qol-back-to-top {
        bottom: 140px;
    }
}
