/*
 * Date: 2025-01-28
 * Update Date: 2025-01-28
 * Author Name: Aahaan
 * File Name: styles.css
 * Purpose: Main stylesheet with soft modern design system for CredHabit
 */

/* ========================================
   Font Import
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ========================================
   CSS Custom Properties (Design Tokens)
======================================== */
:root {
    /* Primary Colors */
    --primary: #5eead4;
    --primary-dark: #14b8a6;
    --primary-light: #ccfbf1;
    
    /* Secondary Colors */
    --secondary: #fcd34d;
    --secondary-light: #fef3c7;
    
    /* Semantic Colors */
    --success: #86efac;
    --success-dark: #4ade80;
    --warning: #fdba74;
    --warning-dark: #fb923c;
    --danger: #fca5a5;
    --danger-dark: #f87171;
    --info: #a5d8ff;
    --info-dark: #74c0fc;
    
    /* Neutral Colors */
    --bg: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Text Colors */
    --text-primary: #374151;
    --text-muted: #9ca3af;
    --text-light: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ========================================
   Base Styles
======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

/* ========================================
   Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

small, .text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-light) !important;
}

/* ========================================
   Bootstrap Overrides - Buttons
======================================== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    color: var(--text-primary);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #fbbf24;
    color: var(--text-primary);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-primary);
}

.btn-success:hover,
.btn-success:focus {
    background-color: var(--success-dark);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-primary);
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: var(--danger-dark);
    color: var(--text-primary);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--text-primary);
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: var(--warning-dark);
    color: var(--text-primary);
}

.btn-info {
    background-color: var(--info);
    color: var(--text-primary);
}

.btn-info:hover,
.btn-info:focus {
    background-color: var(--info-dark);
    color: var(--text-primary);
}

.btn-light {
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-light:hover,
.btn-light:focus {
    background-color: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
    border-radius: var(--radius-md);
}

/* ========================================
   Bootstrap Overrides - Cards
======================================== */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-lg);
    font-weight: 600;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-light);
    padding: var(--space-lg);
}

/* ========================================
   Bootstrap Overrides - Forms
======================================== */
.form-control,
.form-select {
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.625rem 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-color: var(--surface);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-label {
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-check-input:checked {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
    border-color: var(--primary);
}

/* ========================================
   Bootstrap Overrides - Alerts
======================================== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
}

.alert-success {
    background-color: var(--primary-light);
    color: var(--text-primary);
}

.alert-danger {
    background-color: #fee2e2;
    color: var(--text-primary);
}

.alert-warning {
    background-color: var(--secondary-light);
    color: var(--text-primary);
}

.alert-info {
    background-color: #e0f2fe;
    color: var(--text-primary);
}

/* ========================================
   Bootstrap Overrides - Badges
======================================== */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
}

.badge-soft-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-soft-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-soft-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-soft-warning {
    background-color: var(--secondary-light);
    color: #d97706;
}

/* ========================================
   Bootstrap Overrides - Modal
======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-lg);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: var(--space-lg);
}

/* ========================================
   Bootstrap Overrides - Tables
======================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    border-color: var(--border-light);
}

.table > thead {
    background-color: var(--bg);
}

.table > thead > tr > th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.table > tbody > tr > td {
    padding: var(--space-md);
    vertical-align: middle;
}

.table > tbody > tr:hover {
    background-color: var(--bg);
}

/* ========================================
   Bootstrap Overrides - Navbar
======================================== */



.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link.active {
    color: var(--primary-dark);
}

.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    color: var(--primary-dark) !important;
}



/* ========================================
   Bootstrap Overrides - Dropdown
======================================== */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-sm);
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--bg);
    color: var(--text-primary);
}

/* ========================================
   Bootstrap Overrides - Toast
======================================== */
.toast {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background-color: var(--surface);
}

.toast-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-light);
}

/* ========================================
   Custom Components - Stat Card
======================================== */
.stat-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.stat-card-icon.success {
    background-color: #dcfce7;
    color: #16a34a;
}

.stat-card-icon.warning {
    background-color: var(--secondary-light);
    color: #d97706;
}

.stat-card-icon.danger {
    background-color: #fee2e2;
    color: #dc2626;
}

/* ========================================
   Custom Components - Avatar
======================================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ========================================
   Custom Components - Empty State
======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ========================================
   Custom Components - Loading Spinner
======================================== */
.spinner-soft {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Utility Classes
======================================== */
.bg-soft-primary { background-color: var(--primary-light) !important; }
.bg-soft-success { background-color: #dcfce7 !important; }
.bg-soft-danger { background-color: #fee2e2 !important; }
.bg-soft-warning { background-color: var(--secondary-light) !important; }
.bg-soft-info { background-color: #e0f2fe !important; }

.text-primary-dark { color: var(--primary-dark) !important; }
.text-success-dark { color: #16a34a !important; }
.text-danger-dark { color: #dc2626 !important; }
.text-warning-dark { color: #d97706 !important; }

.border-soft { border-color: var(--border) !important; }
.rounded-soft { border-radius: var(--radius-md) !important; }
.shadow-soft { box-shadow: var(--shadow) !important; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ========================================
   Page Layout
======================================== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: var(--space-lg);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ========================================
   Sidebar Navigation
======================================== */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: var(--space-lg);
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: var(--space-xs);
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
    background-color: var(--bg);
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.sidebar-nav-link i {
    font-size: 1.125rem;
    width: 24px;
}

/* Content area with sidebar */
.with-sidebar {
    margin-left: 260px;
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .with-sidebar {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: var(--space-md);
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
}
/* ========================================
   Setup Page (Create Family)
   Add this section to the end of styles.css
======================================== */

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background-color: var(--border);
    transition: all var(--transition);
}

.step-dot.active {
    background-color: var(--primary-dark);
    transform: scale(1.2);
}

.step-dot.completed {
    background-color: var(--success-dark);
}

/* Step Content */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Success Icon */
.success-icon {
    width: 72px;
    height: 72px;
    background-color: var(--success);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

.success-icon i {
    font-size: 2rem;
    color: var(--text-primary);
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Family Code Display */
.family-code-display {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.25rem;
    color: var(--primary-dark);
    background-color: var(--primary-light);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    display: inline-block;
}

/* Child Item */
.child-item {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-item:last-child {
    margin-bottom: 0;
}
