/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #22c55e;
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px;
}

/* বাটন ও ইনপুট থেকে ব্রাউজার ডিফল্ট আউটলাইন সরান */
button, input, select, textarea {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* ===== BACKGROUND BLUR ===== */
.bg-blur {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ===== TOP BAR ===== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--primary-dark);
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Notification Badge */
.badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* ===== STREAK BOX IN TOP BAR ===== */
.streak-btn {
    width: auto !important;
    height: auto !important;
    padding: 4px !important;
    border-radius: 30px !important;
    background: transparent;
    transition: var(--transition);
}

.streak-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 24px;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Light effect when today's streak achieved */
.streak-box.streak-active {
    background: rgba(255, 248, 235, 0.9);
    border-color: #f97316;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.3), 0 0 20px rgba(249, 115, 22, 0.15);
    color: #c2410c;
}

.streak-icon {
    font-size: 1.1rem;
    color: inherit;
    transition: color 0.3s;
}

.streak-box.streak-active .streak-icon {
    color: #f97316;
    animation: pulse-fire 1.8s infinite ease-in-out;
}

@keyframes pulse-fire {
    0%, 100% { transform: scale(1); text-shadow: 0 0 6px #f97316; }
    50% { transform: scale(1.1); text-shadow: 0 0 12px #f97316; }
}

/* Greyed out when today's exam not given */
.streak-box.streak-incomplete {
    background: rgba(241, 241, 241, 0.85);
    border-color: #d1d5db;
    box-shadow: none;
    color: #9ca3af;
}

.streak-box.streak-incomplete .streak-icon {
    color: #9ca3af;
    animation: none;
}

/* ===== GLOBAL LOADER ===== */
.global-loader {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 101;
    overflow: hidden;
}

.loader-bar {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: loading 1.2s infinite ease-in-out;
    border-radius: 0 3px 3px 0;
}

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

.hidden {
    display: none !important;
}

/* ===== MAIN CONTAINER (পরিবর্তিত) ===== */
.app-container {
    margin-top: 64px;
    padding: 20px 0 20px;      /* শুধু উপরে-নিচে, বাম-ডান 0 */
    min-height: calc(100vh - 64px - 70px);
    transition: opacity 0.2s ease;
}

/* ===== PAGE TRANSITIONS ===== */
.page {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.fade-in {
    animation-name: fadeIn;
}

.slide-up {
    animation-name: slideUp;
}

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

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

/* ===== GLASS CARD ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.2);
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 16px;
    background: #e2e8f0;
    border-radius: 8px;
    margin: 8px 0;
    width: 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text.short {
    width: 60%;
}

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

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 8px 0;
    flex: 1;
    transition: var(--transition);
    position: relative;
}

/* Lottie icon container */
.nav-lottie {
    width: 35px;
    height: 35px;
    display: inline-block;
    overflow: hidden;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
    transform: translateX(-50%) scale(0);
    transition: transform 0.2s ease;
}

.nav-item.active::after {
    transform: translateX(-50%) scale(1);
    width: 30px;
}

/* ===== STREAK MESSAGE POPUP (গ্লাস মরফিজম) ===== */
.streak-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.streak-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}
.streak-popup.hidden {
    display: none;
}
.streak-popup-content {
    text-align: center;
    padding: 28px 32px;
    max-width: 320px;
    border-radius: 32px;                /* soft rounded corners */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}
.popup-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: popup-bounce 0.6s ease-out;
}
@keyframes popup-bounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.popup-message {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #1e293b;
    margin: 0;
    min-height: 2.5em;
}
.streak-popup.show::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: -1;
}

/* ===== STREAK CELEBRATION POPUP ===== */
.streak-celebration-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.streak-celebration-popup.show {
    opacity: 1;
    pointer-events: auto;
}
.streak-celebration-popup.hidden {
    display: none;
}
.celebration-content {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 36px;
    padding: 36px 24px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    animation: popup-scale 0.4s ease;
}
@keyframes popup-scale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.popup-flame {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
}
.streak-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}
.streak-big-count {
    font-size: 4rem;
    font-weight: 800;
    color: #f97316;
    line-height: 1;
    margin-bottom: 8px;
}
.streak-subtitle {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.week-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}
.day-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.6;
    position: relative;
}
.day-circle.achieved {
    background: #f97316;
    color: white;
    box-shadow: 0 0 14px #f97316;
    opacity: 1;
    animation: popDay 0.5s ease;
}
.day-circle.today {
    border: 2px solid #f97316;
    font-weight: 700;
}
.day-circle.future {
    background: transparent;
    border: 2px dashed #a0aec0;
    color: #a0aec0;
    opacity: 0.7;
    box-shadow: none;
}
@keyframes popDay {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
.popup-close-btn {
    margin-top: 8px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(99,102,241,0.3);
    transition: var(--transition);
}
.popup-close-btn:hover {
    background: var(--primary-dark);
    transform: scale(0.98);
}

/* ===== UTILITIES ===== */
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 12px;
}

.section-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .greeting-content h1 {
        font-size: 1.5rem;
    }
    .top-bar {
        padding: 0 12px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
