/**
 * Qfunny.com - Main Stylesheet
 * Custom CSS for Bootstrap-based design
 * 
 * Location: D:\www\assets\css\style.css
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
    /* Colors */
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --secondary-color: #10B981;
    --secondary-dark: #059669;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --success-color: #10B981;
    
    /* Neutral Colors */
    --dark-color: #1F2937;
    --gray-color: #6B7280;
    --light-color: #F9FAFB;
    --white: #FFFFFF;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    --gradient-secondary: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* ============================================================================
   NAVBAR STYLES
   ============================================================================ */
.navbar-custom {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
    padding: 0.15rem 0;  /* ULTRA SLIM - reduced from 0.25rem */
    transition: all var(--transition-base);
}

.navbar-custom.scrolled {
    padding: 0.1rem 0;  /* ULTRA SLIM when scrolled */
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-size: 1.3rem;  /* ULTRA SLIM - reduced from 1.35rem */
    font-weight: bold;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-base);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 26px;  /* ULTRA SLIM - reduced from 28px */
    height: 26px;  /* ULTRA SLIM - reduced from 28px */
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;  /* ULTRA SLIM - reduced from 1.35rem */
    font-weight: bold;
    color: var(--primary-color);
    transition: all var(--transition-base);
}

.logo-icon:hover {
    transform: rotate(10deg);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.25rem 1rem !important;  /* ULTRA SLIM - reduced from 0.35rem */
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
/* btn-create and btn-login scoped to navbar — see index.php for authoritative rules */
.navbar-custom .btn-create {
    background: var(--gradient-secondary);
}

.navbar-custom .btn-login {
    background: transparent;
}

/* ============================================================================
   USER AVATAR & DROPDOWN
   ============================================================================ */
.user-avatar {
    width: 30px;  /* ULTRA SLIM - reduced from 32px */
    height: 30px;  /* ULTRA SLIM - reduced from 32px */
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;  /* Smaller font for smaller avatar */
    margin-right: 0.5rem;
    overflow: hidden;
}

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

.dropdown-menu {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: none;
    margin-top: 0.5rem;
    animation: dropdownSlide 0.3s ease;
}

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

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--light-color);
    padding-left: 1.25rem;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 20px;
}

/* ============================================================================
   FOOTER STYLES
   ============================================================================ */
.footer-custom {
    background: var(--dark-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.footer-heading {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

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

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all var(--transition-base);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

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

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

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0 1.5rem;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.newsletter-form .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.newsletter-form .form-control {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: none;
}

.newsletter-form .btn {
    border: none;
}

/* ============================================================================
   BACK TO TOP BUTTON
   ============================================================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

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

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 0.75rem 0;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

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

.card-img-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    height: 200px;
    object-fit: cover;
}

/* ============================================================================
   QUIZ CARDS (Specific)
   ============================================================================ */
.quiz-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

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

.quiz-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.quiz-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quiz-card-stats {
    display: flex;
    gap: 1rem;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.quiz-card-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */
.badge-custom {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.badge-primary {
    background: var(--gradient-primary);
}

.badge-secondary {
    background: var(--gradient-secondary);
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */
.spinner-custom {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 70, 229, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */
.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

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

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

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

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .nav-link.active::after {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Removed logo/brand size overrides - keep slim navbar on mobile too */
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.gradient-primary {
    background: var(--gradient-primary);
}

.gradient-secondary {
    background: var(--gradient-secondary);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

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

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

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .navbar,
    .footer-custom,
    .back-to-top {
        display: none;
    }
}
