/* |--------------------------------------------------------------------------
   | PWA & MOBILE APP UI STYLES
   |-------------------------------------------------------------------------- */

   /* Default Dark Theme (Your current look) */
:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: #111827;
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --nav-bg: #1e293b; /* Keep navbar dark for contrast, or change to #ffffff */
}

/* Apply Variables */
body {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    transition: background 0.3s ease;
}

.card, .modal-content, .note-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.text-muted { color: var(--text-muted) !important; }

/* Fix for the bottom nav in light mode */
[data-theme="light"] .pwa-nav {
    background-color: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}


/* Add to style.css */
textarea#noteInput {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
}

[data-theme="light"] .navbar-brand {
    color: #1e293b !important;
}
:root {
    --primary-color: #4f46e5;
    --nav-height: 65px;
}

body {
    padding-bottom: 80px; /* Space for bottom nav on mobile */
    background-color: #f3f4f6;
}

@media (min-width: 992px) {
    body { padding-bottom: 20px; }
}

/* Bottom Navigation (Mobile Only) */
.pwa-nav {
    background-color: var(--bg-card) !important; /* Uses the theme's card color */
    border-top: 1px solid var(--border-color) !important;
    height: 70px;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border 0.3s ease;
}

.pwa-nav .nav-item {
    color: var(--text-muted); /* Silver in dark mode, Gray in light */
    background: transparent;
    transition: all 0.2s ease;
}

.pwa-nav .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

/* Active State for Mobile Icons */
.pwa-nav .nav-item.active {
    color: #4f46e5 !important; /* Keep the brand blue for the active icon */
}

/* Light Theme Specific Adjustment */
[data-theme="light"] .pwa-nav {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}


.nav-item {
    flex: 1;
    text-align: center;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
    transition: 0.2s;
    border: none;
    background: none;
}

.nav-item i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 2px;
}

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

/* App Sections */
.app-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* File Dropzone */
.dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    background: #fff;
    cursor: pointer;
}

.dropzone.dragover {
    border-color: var(--primary-color);
    background: #eef2ff;
}

/* Note Cards (Masonry) */
.note-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid #e5e7eb;
}


/* Add this to your assets/css/style.css or header.php */
.nav-item {
    outline: none !important;
    box-shadow: none !important;
}

.nav-item i {
    transition: transform 0.2s ease;
}

.nav-item.active i {
    transform: translateY(-3px);
    color: #4f46e5;
}

.nav-item.active span {
    font-weight: 600;
}

.cursor-pointer {
    cursor: pointer !important;
}




/* Custom Header Styling */
.navbar-nav .nav-link {
    color: #a0a0a0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background: #4f46e5 !important; /* Indigo primary */
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Glassmorphism effect for the session badge container */
.bg-dark.border-secondary {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Brand icon pulse effect */
.navbar-brand:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}


/* Styling for when the user is typing manually */
.manual-style {
    border-radius: 0.5rem !important; /* Force rounded corners */
    transition: all 0.3s ease;
    border: 2px solid #4f46e5 !important; /* Highlight the box when typing */
    /* background-color: rgba(255, 255, 255, 0.05) !important; */
}

/* Ensure the input takes full width when not in a group */
#passkeyField:not(.input-group > #passkeyField) {
    width: 100%;
}

/* Make the text extra clear for the user */
#passkeyField {
    letter-spacing: 2px;
    font-size: 1.25rem;
    border: 2px solid #4f46e5 !important;
}



.refresh-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--bs-secondary);
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: var(--bs-primary);
    transform: scale(1.1);
}

.refresh-btn i {
    font-size: 0.85rem;
}

/* Ensure the spin animation is smooth */
.fa-spin {
    animation: fa-spin 0.8s infinite linear;
}



/* Card sizing: Squeeze for small, cap for large */
.note-item .card {
    min-height: 120px; /* Minimum size for very short notes */
    max-height: 280px; /* Maximum size before cutting off */
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

/* Ensure the body takes up space but clips long text */
.note-item .card-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* The "Squeeze" logic: Show up to 8 lines, then clip */
.note-preview-content {
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 8; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 0;
}
/* Custom colors for themes */
.bg-card { background-color: #ffffff; }
.bg-danger-subtle { background-color: #fff5f5 !important; }
.bg-warning-subtle { background-color: #fffdf2 !important; }
.bg-info-subtle { background-color: #f0f7ff !important; }
.bg-success-subtle { background-color: #f2fff5 !important; }


/* Note Card Colors */
.bg-card { background-color: #ffffff !important; }
.bg-light-blue { background-color: #e7f3ff !important; }
.bg-light-green { background-color: #e4f9e0 !important; }
.bg-light-yellow { background-color: #fff4d1 !important; }
.bg-light-pink { background-color: #ffe4e1 !important; }
.bg-light-purple { background-color: #f3e8ff !important; }

/* Optional: Subtle border for colored cards */
.note-item .card {
    border: 1px solid rgba(0,0,0,0.05) !important;
}

/* Card Base for Themes */
.note-item .card[class*="theme-"] {
    background-repeat: no-repeat !important;
    background-position: bottom center !important;
    background-size: 100% auto !important;
    transition: background-color 0.3s ease;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

/* Ensure the text doesn't get "drowned" by the image */
/* We add a slight fade/overlay if the note is very long */
.note-item .card[class*="theme-"] .card-body {
    z-index: 1;
    position: relative;
    /* Optional: text-shadow makes text readable over busy illustrations */
    text-shadow: 0 0 10px rgba(255,255,255,0.5); 
}

/* --- 2. Plain Color Themes (The missing part!) --- */
.theme-default { background-color: #ffffff !important; background-image: none !important; }
.theme-red     { background-color: #f28b82 !important; background-image: none !important; }
.theme-orange  { background-color: #e4ab60 !important; background-image: none !important; }
.theme-yellow  { background-color: #fff475 !important; background-image: none !important; }
.theme-green   { background-color: #ccff90 !important; background-image: none !important; }
.theme-teal    { background-color: #a7ffeb !important; background-image: none !important; }
.theme-blue    { background-color: #cbf0f8 !important; background-image: none !important; }

/* Theme Images (Using placeholder patterns) */
.theme-grocery { 
    background-color: #e8eaed !important; 
    background-image: url('https://www.gstatic.com/keep/backgrounds/grocery_light_0609.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: bottom right !important;
}
.theme-food { 
    background-color: #fff475 !important; 
    background-image: url('https://www.gstatic.com/keep/backgrounds/food_light_0609.svg') !important; 
}
.theme-music { 
    background-color: #f3e8ff !important; 
    background-image: url('https://www.gstatic.com/keep/backgrounds/music_light_0609.svg') !important; 
}
.theme-travel { 
    background-color: #e7f3ff !important; 
    background-image: url('https://www.gstatic.com/keep/backgrounds/travel_light_0609.svg') !important; 
}
.theme-celebration { 
    background-color: #e8eaed !important; 
    background-image: url('https://www.gstatic.com/keep/backgrounds/celebration_light_0609.svg') !important; 
}


.note-item .card[class*="theme-"], 
.swal2-popup[class*="theme-"] {
    background-repeat: no-repeat !important;
    background-position: bottom center !important;
    background-size: 100% auto !important;
    transition: background-color 0.3s ease;
}

.swal2-popup[class*="theme-"] #modalPreContent,
.swal2-popup[class*="theme-"] #modalEditArea {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(2px); 
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.theme-content-area {
    background: rgba(255, 255, 255, 0.25) !important; 
    backdrop-filter: blur(4px); 
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #202124 !important; 
}

.swal2-title {
    margin-top: 10px !important;
    background: transparent !important;
}