/**
 * MrsZoya - Main Stylesheet
 * Premium Modern UI with Animations
 */

/* =====================================================
   BASE STYLES
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: rgba(16, 185, 129, 0.2);
    color: inherit;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(0deg); }
    75% { transform: translateY(-20px) rotate(-2deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); }
}

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

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

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce-in {
    from { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: currentColor; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

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

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

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.6; }
    25% { transform: translateY(-30px) translateX(10px) rotate(90deg); opacity: 1; }
    50% { transform: translateY(-15px) translateX(-10px) rotate(180deg); opacity: 0.8; }
    75% { transform: translateY(-40px) translateX(5px) rotate(270deg); opacity: 0.4; }
}

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

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Hover Card */
.hover-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .hover-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #10B981, #3B82F6, #8B5CF6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 4s ease infinite;
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #E5E7EB;
    overflow: hidden;
}

.dark .progress-bar {
    background: #334155;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #10B981, #34D399);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #E5E7EB;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dark .btn-secondary {
    background: #1E293B;
    color: #E2E8F0;
    border-color: #334155;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Input Styles */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid #E5E7EB;
    background: white;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

.dark .input-field {
    background: #1E293B;
    border-color: #334155;
    color: #E2E8F0;
}

.input-field:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.dark .badge-primary {
    background: rgba(16, 185, 129, 0.2);
}

/* Streak Fire Animation */
.streak-fire {
    display: inline-block;
    animation: bounce 1s ease infinite;
}

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

/* XP Gain Animation */
.xp-gain {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-weight: 700;
    color: #F59E0B;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: xpFloat 1.5s ease-out forwards;
}

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

/* Chat Bubble */
.chat-bubble {
    max-width: 80%;
    padding: 0.875rem 1.25rem;
    border-radius: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    animation: scale-in 0.2s ease-out;
}

.chat-bubble-user {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-bottom-right-radius: 0.25rem;
    margin-left: auto;
}

.chat-bubble-ai {
    background: white;
    border: 1px solid #E5E7EB;
    border-bottom-left-radius: 0.25rem;
}

.dark .chat-bubble-ai {
    background: #1E293B;
    border-color: #334155;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem 1.25rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: calc(100vh - 4rem);
    position: fixed;
    top: 4rem;
    left: 0;
    background: white;
    border-right: 1px solid #E5E7EB;
    overflow-y: auto;
    z-index: 40;
    transition: transform 0.3s ease;
}

.dark .sidebar {
    background: #0F172A;
    border-color: #1E293B;
}

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6B7280;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-link:hover {
    background: #F3F4F6;
    color: #374151;
}

.dark .sidebar-link:hover {
    background: #1E293B;
    color: #E2E8F0;
}

.sidebar-link.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.sidebar-link.active i {
    color: #10B981;
}

/* Main Content Area */
.main-content {
    margin-left: 0;
    padding: 1.5rem;
    min-height: calc(100vh - 4rem);
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 260px;
    }
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid #F3F4F6;
    transition: all 0.3s;
}

.dark .stat-card {
    background: #1E293B;
    border-color: #334155;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Subject Card */
.subject-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #F3F4F6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dark .subject-card {
    background: #1E293B;
    border-color: #334155;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--subject-color, #10B981);
    opacity: 0;
    transition: opacity 0.3s;
}

.subject-card:hover::before {
    opacity: 1;
}

/* Achievement Badge */
.achievement-badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    transition: all 0.3s;
}

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

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

/* Calendar Heatmap */
.calendar-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    transition: all 0.2s;
}

.calendar-cell:hover {
    transform: scale(1.3);
    outline: 2px solid #10B981;
}

/* Floating Particles */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite;
}

/* Card Skeleton */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1E293B 25%, #334155 50%, #1E293B 75%);
    background-size: 200% 100%;
}

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

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.375rem 0.75rem;
    background: #1F2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.dark .modal-content {
    background: #1E293B;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out;
    max-width: 380px;
}

.dark .toast {
    background: #1E293B;
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white !important;
    }
}
