/* ========================================
   SUNNAHSYNC - MODERN 2026 DESIGN SYSTEM
   Glassmorphism + Islamic Color Palette
   ======================================== */

/* ========================================
   CSS VARIABLES - Easy theme customization
   ======================================== */
:root {
    /* Islamic Color Palette - Calming and spiritual */
    --primary: #0FA3B1;        /* Teal - Spirituality */
    --primary-dark: #0D8A96;   /* Darker teal */
    --primary-light: #4FC5D4;  /* Light teal */
    --secondary: #F9C74F;      /* Gold - Divine light */
    --success: #43AA8B;        /* Green - Growth */
    --danger: #F94144;         /* Soft red - Important */
    --purple: #B185DB;         /* Purple - Spiritual */
    
    /* Neutral colors */
    --text-dark: #1A202C;
    --text-medium: #4A5568;
    --text-light: #718096;
    --bg-light: #F7FAFC;
    --bg-white: #FFFFFF;
    
    /* Gradients for wow factor */
    --gradient-primary: linear-gradient(135deg, #0FA3B1 0%, #4FC5D4 100%);
    --gradient-secondary: linear-gradient(135deg, #F9C74F 0%, #F8961E 100%);
    --gradient-success: linear-gradient(135deg, #43AA8B 0%, #90E6CA 100%);
    --gradient-purple: linear-gradient(135deg, #B185DB 0%, #8B5FBF 100%);
    --gradient-hero: linear-gradient(135deg, #0FA3B1 0%, #B185DB 100%);
    
    /* Glassmorphism effect */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* Shadows - Depth and elevation */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.20);
    
    /* Spacing system */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Typography */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: contain;
}

/* ========================================
   SPLASH SCREEN - Beautiful loading animation
   ======================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-hero);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.splash-icon {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    animation: pulse 2s infinite;
}

.splash-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.5px;
}

.splash-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-xl);
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: white;
    width: 0%;
    border-radius: var(--radius-full);
    animation: loadingBar 2s ease-in-out infinite;
}

/* ========================================
   APP CONTAINER - Main layout
   ======================================== */
.app-container {
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
    background: var(--bg-light);
}

/* ========================================
   HEADER - User info with Telegram avatar
   ======================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 800px;
    margin: 0 auto;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.header-info {
    flex: 1;
}

.greeting {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.user-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gradient-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

.streak-number {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
}

.streak-icon {
    font-size: 1.2rem;
}

/* ========================================
   MAIN CONTENT - Scrollable area
   ======================================== */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-lg);
    animation: fadeIn 0.5s ease;
}

/* ========================================
   CARDS - Glassmorphism effect
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--glass-shadow);
}

/* ========================================
   GRADIENT CARDS - Eye-catching hero cards
   ======================================== */
.gradient-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.gradient-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 8s linear infinite;
}

/* ========================================
   BUTTONS - Multiple styles for different uses
   ======================================== */
.btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-decoration: none;
    min-height: 48px; /* Touch-friendly */
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

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

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

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-large {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.2rem;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ========================================
   BOTTOM NAVIGATION - Glassmorphism style
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
    min-width: 60px;
}

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

.nav-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.nav-btn:active .nav-icon {
    transform: scale(0.9);
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
}

/* ========================================
   PROGRESS BARS - Animated and colorful
   ======================================== */
.progress-container {
    background: var(--bg-light);
    border-radius: var(--radius-full);
    height: 12px;
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

/* ========================================
   CELEBRATION MODAL - Full screen joy!
   ======================================== */
.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-success);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.celebration-content {
    text-align: center;
    animation: bounceIn 0.6s ease;
}

.celebration-icon {
    font-size: 6rem;
    margin-bottom: var(--space-lg);
    animation: pulse 1s infinite;
}

.celebration-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-md);
}

.celebration-message {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* ========================================
   TOAST NOTIFICATIONS - Slide from top
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 90%;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideDown 0.3s ease;
}

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

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

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

/* ========================================
   WEEK CALENDAR - Visual day tracker
   ======================================== */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

.day-circle {
    aspect-ratio: 1;
    border-radius: var(--radius-full);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    border: 2px solid var(--bg-light);
    transition: all 0.3s ease;
}

.day-circle.today {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.day-circle.completed {
    background: var(--gradient-success);
    color: white;
    border-color: var(--success);
}

.day-circle.completed::after {
    content: '✓';
    font-size: 1.2rem;
}

/* ========================================
   ACHIEVEMENT BADGES - Unlock system
   ======================================== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.achievement-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-lg);
    animation: pulse 2s infinite;
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.achievement-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.achievement-progress {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ========================================
   JOURNAL ENTRIES - Beautiful card layout
   ======================================== */
.journal-entry {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.journal-entry:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-md);
}

.journal-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.journal-actions {
    display: flex;
    gap: var(--space-sm);
}

.journal-content {
    line-height: 1.6;
    color: var(--text-medium);
}

.journal-mood {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--bg-light);
    font-size: 1.5rem;
}

/* ========================================
   MODAL - For dialogs and forms
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-header {
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ========================================
   FORMS - Beautiful input fields
   ======================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--bg-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

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

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

/* ========================================
   MOOD SELECTOR - Emoji buttons
   ======================================== */
.mood-selector {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.mood-btn {
    font-size: 2.5rem;
    padding: var(--space-md);
    background: var(--bg-light);
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-btn:hover {
    transform: scale(1.1);
}

.mood-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.15);
}

/* ========================================
   STATS GRID - Beautiful metrics display
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   ANIMATIONS - Smooth and delightful
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

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

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

@keyframes loadingBar {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* ========================================
   RESPONSIVE - Mobile-first approach
   ======================================== */
@media (max-width: 480px) {
    .splash-title {
        font-size: 2rem;
    }
    
    .celebration-title {
        font-size: 2rem;
    }
    
    .achievement-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UTILITY CLASSES - Quick styling
   ======================================== */
.text-center { text-align: center; }
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-lg { margin-top: var(--space-lg); }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ========================================
   SCROLLBAR - Custom styling
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}


