/* Modern Dynamic Design for Young Community (All Ages) */

/* ==================== COLOR PALETTE ==================== */
:root {
    /* Primary Colors - Teal/Cyan (friendly, fresh) */
    --primary: #14b8a6;
    --primary-light: #5eead4;
    --primary-dark: #0d9488;

    /* Secondary Colors - Orange/Coral (energetic) */
    --secondary: #f97316;
    --secondary-light: #fb923c;
    --secondary-dark: #ea580c;

    /* Accent Colors */
    --accent-pink: #ec4899;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-yellow: #fbbf24;
    --accent-blue: #06b6d4;

    /* Neutral Colors */
    --bg-light: #f0fdfa;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-gray: #64748b;
    --border-light: #e2e8f0;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #e0f2fe, #fef3c7);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary-dark));
    background-clip: padding-box;
}

/* Animated Background with Floating Shapes */
body {
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 25%, #fef3c7 50%, #ffe4e6 75%, #f0fdfa 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    position: relative;
    overflow-x: hidden;
}

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

/* ==================== CARD STYLES ==================== */
.card-modern {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    position: relative;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.1), transparent);
    transition: left 0.5s ease;
}

.card-modern:hover::before {
    left: 100%;
}

.card-modern:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(20, 184, 166, 0.2);
}

/* Glass Morphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ==================== BUTTON STYLES ==================== */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: white;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn-gradient-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-gradient-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(20, 184, 166, 0.4);
}

.btn-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--accent-pink));
    color: white;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-gradient-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ==================== ANIMATIONS ==================== */
/* Bounce Animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(20, 184, 166, 0.3),
                    0 0 20px rgba(20, 184, 166, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.6),
                    0 0 40px rgba(20, 184, 166, 0.4);
    }
}

/* Floating Animation */
@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.float {
    animation: floating 3s ease-in-out infinite;
}

/* Fade In Up */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Slide In Left */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

/* Slide In Right */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* Rotate In */
.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ==================== INTERACTIVE PANELS ==================== */
.panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.panel:hover {
    box-shadow: 0 8px 30px rgba(20, 184, 166, 0.15);
    transform: translateX(4px);
}

.panel-header {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: white;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.panel-header:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0891b2);
}

.panel-header .icon {
    transition: transform 0.3s ease;
}

.panel-header.active .icon {
    transform: rotate(180deg);
}

.panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.panel-content.active {
    max-height: 2000px;
    padding: 20px;
}

/* ==================== MODAL STYLES ==================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    animation: backdropFadeIn 0.3s ease-out;
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: white;
    padding: 24px;
    border-radius: 24px 24px 0 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-blue), var(--secondary));
    background-size: 200% 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
    animation: gradientMove 3s ease infinite;
}

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

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--accent-pink));
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--accent-yellow), #f59e0b);
    color: white;
}

.badge-premium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #f97316);
    color: white;
    animation: premiumShine 3s ease infinite;
}

@keyframes premiumShine {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
}

/* ==================== TOOLTIP ==================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(20, 184, 166, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

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

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    border-left: 4px solid var(--primary);
}

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

.toast-success {
    border-left-color: var(--accent-green);
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: var(--accent-yellow);
}

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ==================== XP & GAMIFICATION ==================== */
.xp-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: xpPulse 2s ease infinite;
}

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

/* Streak Fire */
.streak-fire {
    animation: fire 1.5s ease-in-out infinite;
}

@keyframes fire {
    0%, 100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateY(-2px);
        filter: hue-rotate(10deg);
    }
}

/* Badge Unlock Animation */
.badge-unlock {
    animation: badgeUnlock 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeUnlock {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Level Up Effect */
.level-up {
    animation: levelUp 1s ease-out;
}

@keyframes levelUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
}
