/* 
 * My Planner — Premium Ultra-Minimalist & Tactile Web App
 * Directly inspired by state-of-the-art physical device presentation
 */

:root {
    /* Theme Tokens - Light Mode by default, matching the warm light grey matte image */
    --bg-canvas: #ECECEC;           /* Outer desk background */
    --bg-app: #E5E5E5;              /* Phone body warm matte light grey */
    --bg-surface: #E5E5E5;
    --bg-panel: #EAEAEA;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-checkbox: rgba(0, 0, 0, 0.15);
    
    --text-primary: #1A1A1A;
    --text-secondary: #7A7A7A;
    --text-muted: #9E9E9E;
    
    /* Premium Brand Colors */
    --accent-color: #FF5C00;        /* Vibrant Sunset Orange */
    --accent-glow: rgba(255, 92, 0, 0.15);
    --accent-completed: #FF5C00;    /* Strikethrough & completed tasks in active orange */
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    
    /* Phone mockup frame details */
    --mockup-border: #111111;
    --mockup-shadow: 0 30px 60px rgba(0, 0, 0, 0.12), 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* Dark Mode Overrides - Matte Charcoal */
body.dark-mode {
    --bg-canvas: #121212;
    --bg-app: #1E1E1E;
    --bg-surface: #1E1E1E;
    --bg-panel: #252528;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-checkbox: rgba(255, 255, 255, 0.2);
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-muted: #555558;
    
    --accent-completed: #FF5C00;    /* Muted orange or active glowing orange */
    --mockup-border: #2C2C2E;
    --mockup-shadow: 0 40px 100px rgba(0, 0, 0, 0.5), 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------------------
 * Desktop Smartphone Mockup Layout
 * Displays the app inside a physical phone frame on desktop,
 * and rolls back to full-screen on mobile devices.
 * ---------------------------------------------------- */
.desktop-canvas {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-canvas);
    transition: background-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Floating Light/Dark presentation toggle */
.desktop-theme-toggle {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 100;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.desktop-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.phone-mockup {
    width: 400px;
    height: 850px;
    background: var(--mockup-border);
    border-radius: 48px;
    padding: 12px;
    box-shadow: var(--mockup-shadow);
    position: relative;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    border: 4px solid rgba(128,128,128,0.15);
}

/* Dynamic Island camera notch cutout */
.dynamic-island {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 28px;
    background: #000000;
    border-radius: 20px;
    z-index: 1000;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.1);
    pointer-events: none;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    border-radius: 38px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease;
}

/* Simulated iOS Status Bar */
.simulated-status-bar {
    height: 40px;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    z-index: 999;
    user-select: none;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-icons i {
    font-size: 11px;
}

/* ----------------------------------------------------
 * Core App Container
 * ---------------------------------------------------- */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-bottom: 72px; /* Bottom Nav buffer */
}

/* ----------------------------------------------------
 * Premium Minimalist Header
 * ---------------------------------------------------- */
.app-header {
    padding: 10px 24px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-badge {
    display: none; /* Hide legacy bulky astronaut avatar */
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-greeting {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-display-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

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

.header-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.header-action-btn:hover {
    color: var(--text-primary);
    background: rgba(128, 128, 128, 0.08);
}

/* Theme Icon Toggles */
body.dark-mode .sun-icon { display: block; }
body.dark-mode .moon-icon { display: none; }
body:not(.dark-mode) .sun-icon { display: none; }
body:not(.dark-mode) .moon-icon { display: block; }


/* ----------------------------------------------------
 * Scrollable App Main Content Panes
 * ---------------------------------------------------- */
.app-main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide standard scrollbar but allow scrolling */
.app-main-content::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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


/* ----------------------------------------------------
 * MODULE 1: Weekly Accordion Plan
 * ---------------------------------------------------- */
.planner-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    user-select: none;
}

.nav-arrow-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    background: transparent;
    font-size: 12px;
    transition: var(--transition-smooth);
}

.nav-arrow-btn:active {
    transform: scale(0.9);
    background: rgba(128, 128, 128, 0.08);
}

.week-range-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
}

.accordion-container {
    display: flex;
    flex-direction: column;
}

/* Individual Day Accordion Cards */
.day-card {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
    transition: var(--transition-smooth);
}

.day-card:last-child {
    border-bottom: none;
}

.day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.day-title-wrapper {
    display: flex;
    flex-direction: column;
}

.day-card-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.0;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

/* In reference photo: other days have slightly lower contrast */
.day-card:not(.expanded) .day-card-title {
    color: var(--text-secondary);
}

.day-card-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
    margin-top: 4px;
    opacity: 0.8;
}

/* Elegant numeric badge counter for collapsed days */
.day-card-badge {
    background: var(--text-secondary);
    color: var(--bg-app);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.day-card.expanded .day-card-badge {
    display: none; /* Hide badge when expanded */
}

/* Day Collapsible Items Container */
.day-card-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

.day-card.expanded .day-card-body {
    max-height: 1000px;
    opacity: 1;
    margin-top: 18px;
}

.day-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ----------------------------------------------------
 * Pristine Checklist Items (Exactly like reference photo)
 * ---------------------------------------------------- */
.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    gap: 12px;
    animation: slideInItem 0.25s ease;
}

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

.checklist-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

/* Rounded Square Custom Checkbox */
.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border-checkbox);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 2px;
    flex-shrink: 0;
}

.custom-checkbox i {
    font-size: 9px;
    color: #FFFFFF;
    opacity: 0;
    transition: var(--transition-smooth);
}

/* Text label styling */
.checklist-title-span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    transition: var(--transition-smooth);
}

/* Complete Completed States */
.item-completed .custom-checkbox {
    background: var(--accent-completed);
    border-color: var(--accent-completed);
}

.item-completed .custom-checkbox i {
    opacity: 1;
}

.item-completed .checklist-title-span {
    color: var(--accent-completed);
    text-decoration: line-through;
    opacity: 0.8;
}

/* Subtle Tags in List Item */
.item-meta-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.tag-event {
    background: rgba(128,128,128,0.1);
    color: var(--text-primary);
}

.tag-payment {
    background: rgba(255,92,0,0.1);
    color: var(--accent-color);
}

.tag-shopping {
    background: rgba(128,128,128,0.08);
    color: var(--text-secondary);
}

/* Clean line trash can delete button */
.item-delete-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0.5;
}

.item-delete-btn:hover {
    color: #EF4444;
    opacity: 1;
}


/* Borderless Quick Add Input (Matches reference photo placeholder) */
.accordion-quick-add-form {
    margin-top: 14px;
}

.inline-quick-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.inline-quick-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}


/* ----------------------------------------------------
 * MODULE 2: Intelligent Notes Database
 * ---------------------------------------------------- */
.notes-header-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 20px;
}

.search-bar {
    flex: 1;
    background: rgba(128, 128, 128, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon {
    font-size: 13px;
    color: var(--text-secondary);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    font-family: var(--font-body);
}

.add-note-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.add-note-btn:active {
    transform: scale(0.9);
}

.notes-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Minimalist Note Rows */
.note-mobile-card {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.note-mobile-card:hover {
    transform: translateX(2px);
}

.note-m-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.note-m-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.note-m-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
}

.note-m-tags {
    color: var(--accent-color);
}

.note-m-date {
    color: var(--text-muted);
}

/* Slide-Up Note Editor Pane (Full View inside phone screen) */
.note-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-app);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 38px;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.editor-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header {
    height: 56px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.editor-close-btn {
    font-size: 18px;
    color: var(--text-secondary);
}

.editor-status-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.editor-header-actions {
    display: flex;
    gap: 16px;
}

.editor-save-btn, .editor-delete-btn {
    font-size: 16px;
    color: var(--text-secondary);
}

.editor-save-btn:hover { color: var(--accent-color); }
.editor-delete-btn:hover { color: #EF4444; }

.editor-scroll-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-title-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.editor-tags-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.editor-tags-row i {
    font-size: 12px;
}

.editor-tags-row input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    color: var(--text-primary);
    width: 100%;
    font-family: var(--font-body);
}

.editor-textarea-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: var(--font-body);
}


/* ----------------------------------------------------
 * MODULE 3: Shopping Checklist
 * ---------------------------------------------------- */
.shopping-lists-selector-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 20px;
}

.lists-select-wrapper {
    flex: 1;
    background: rgba(128, 128, 128, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    position: relative;
}

.lists-select {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-body);
    appearance: none;
    cursor: pointer;
}

.add-list-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.add-list-btn:active { transform: scale(0.9); }

.shopping-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.shopping-placeholder i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.shopping-placeholder p {
    font-size: 14px;
}

.shopping-quick-add-row {
    display: flex;
    gap: 10px;
    background: rgba(128, 128, 128, 0.04);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 20px;
}

.quick-add-title {
    flex: 2;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
}

.quick-add-qty {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
}

.quick-add-submit-btn {
    border: none;
    background: transparent;
    color: var(--accent-color);
    font-size: 14px;
    padding: 4px;
}


/* ----------------------------------------------------
 * MODULE 4: Payments Ledger
 * ---------------------------------------------------- */
.payments-overview-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-bottom: 24px;
}

.pay-stat-card {
    background: rgba(128,128,128,0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    gap: 10px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.icon-pending { background: rgba(255,92,0,0.1); color: var(--accent-color); }
.icon-paid { background: rgba(16,185,129,0.1); color: #10B981; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.payments-ledger-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
}

.payments-ledger-title h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-payment-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.payments-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Modern Minimalist Payment Card */
.payment-mobile-card {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.pay-card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.pay-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.pay-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.pay-card-recur {
    color: var(--accent-color);
}

.pay-card-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pay-card-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pay-card-amount {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.pay-status-pill {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.status-paid { background: rgba(16,185,129,0.1); color: #10B981; }
.status-pending { background: rgba(255,92,0,0.1); color: var(--accent-color); }

.pay-card-actions {
    display: flex;
    gap: 6px;
}

.pay-action-circle-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-secondary);
}

.pay-action-circle-btn:hover {
    color: var(--text-primary);
    background: rgba(128,128,128,0.05);
}


/* ----------------------------------------------------
 * Sleek Glassmorphic Bottom Navigation Bar
 * ---------------------------------------------------- */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(229, 225, 225, 0.85); /* Matched to light warm grey */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 99;
    border-radius: 0 0 38px 38px; /* Curve inside phone screen */
    padding: 0 10px;
}

body.dark-mode .bottom-nav {
    background: rgba(30, 30, 30, 0.85);
}

.nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item i {
    font-size: 16px;
    transition: var(--transition-bounce);
}

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

.nav-item.active i {
    transform: translateY(-2px);
}


/* ----------------------------------------------------
 * Login Container Layout
 * ---------------------------------------------------- */
.login-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-app);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 1000;
    border-radius: 38px;
}

.login-card {
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.brand-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--accent-color);
    color: #FFFFFF;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 10px 24px var(--accent-glow);
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-alert {
    background: rgba(255,92,0,0.06);
    border: 1px dashed var(--accent-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 24px;
}

.login-alert i {
    color: var(--accent-color);
    font-size: 14px;
    margin-top: 2px;
}

.login-alert p {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent-color);
    color: #FFFFFF;
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 14px var(--accent-glow);
}


/* ----------------------------------------------------
 * Dynamic Element Creation Modal (Bottom Sheet style)
 * ---------------------------------------------------- */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
}

.bottom-sheet-modal {
    background: var(--bg-app);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 80%;
    overflow-y: auto;
    animation: slideUpModal 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--border-color);
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: -12px auto 8px;
    opacity: 0.4;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-close-btn {
    font-size: 20px;
    color: var(--text-secondary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.form-control {
    background: rgba(128, 128, 128, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    width: 100%;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}


/* ----------------------------------------------------
 * Responsive Media Queries
 * Below 800px width, all phone frame mockups are hidden
 * and the app displays full-screen, adapting perfectly to Notch.
 * ---------------------------------------------------- */
@media screen and (max-width: 800px) {
    body {
        background-color: var(--bg-app);
    }
    
    .desktop-canvas {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }
    
    .desktop-theme-toggle {
        display: none !important; /* Hide desktop button, use header switch */
    }
    
    .phone-mockup {
        width: 100%;
        height: 100%;
        background: transparent !important;
        border-radius: 0;
        padding: 0;
        border: none !important;
        box-shadow: none !important;
    }
    
    .dynamic-island {
        display: none !important; /* Hide black island frame cutout */
    }
    
    .phone-screen {
        border-radius: 0;
    }
    
    .simulated-status-bar {
        display: none !important; /* Hide simulated iOS bars, let phone display native */
    }
    
    .bottom-nav {
        border-radius: 0; /* Flat bar on real phone screens */
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(60px + env(safe-area-inset-bottom));
    }
    
    .note-editor-overlay {
        border-radius: 0;
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    @media screen and (max-width: 800px) {
        .app-header {
            padding-top: calc(10px + env(safe-area-inset-top));
        }
    }
}

/* Loading Overlay and Spinner */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 92, 0, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

