/* ============================================
   Monara - מסע לזוהר הצפוני
   Clean, Light, Simple Design
   ============================================ */

:root {
    /* Colors - Light & Clean */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-soft: #f0efff;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --border: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.08);
    
    /* Aurora Colors */
    --aurora-green: #00d9a5;
    --aurora-purple: #a855f7;
    --aurora-blue: #3b82f6;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.screen {
    display: none;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.screen.active {
    display: flex;
}

/* ============================================
   Login Screen
   ============================================ */
#login-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, 
        rgba(0, 217, 165, 0.15) 0%, 
        rgba(168, 85, 247, 0.1) 30%, 
        transparent 70%);
    animation: aurora 15s ease-in-out infinite;
}

@keyframes aurora {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10%, 10%) rotate(5deg); }
    50% { transform: translate(-5%, 15%) rotate(-3deg); }
    75% { transform: translate(-10%, 5%) rotate(2deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-xl);
}

.logo {
    margin-bottom: var(--space-xl);
}

.aurora-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px var(--aurora-green)); }
    to { filter: drop-shadow(0 0 25px var(--aurora-purple)); }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: white;
    letter-spacing: 4px;
    margin-bottom: var(--space-sm);
}

.logo p {
    color: var(--aurora-green);
    font-size: 1rem;
    font-weight: 300;
}

.pin-input-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 280px;
    margin: 0 auto;
}

#pin-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: 1.2rem;
    color: white;
    text-align: center;
    letter-spacing: 4px;
    transition: var(--transition);
}

#pin-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: normal;
}

#pin-input:focus {
    outline: none;
    border-color: var(--aurora-green);
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--aurora-green), var(--aurora-purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    min-height: 24px;
}

/* ============================================
   Main App
   ============================================ */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--bg-secondary);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sync-indicator {
    font-size: 1.2rem;
    cursor: help;
    opacity: 0.7;
    transition: var(--transition);
}

.sync-indicator:hover {
    opacity: 1;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--accent-soft);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) 0;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item:hover {
    background: var(--accent-soft);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Views Container */
.views-container {
    flex: 1;
    padding: var(--space-md);
    padding-bottom: 80px; /* Space for bottom nav */
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
}

.btn-add {
    background: var(--accent);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ============================================
   Map View
   ============================================ */
.phases-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.phase-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px var(--shadow);
}

.phase-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.phase-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.phase-icon {
    font-size: 1.5rem;
}

.phase-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

#map-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px var(--shadow);
    overflow: hidden;
}

.map-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.map-placeholder p {
    margin: var(--space-sm) 0;
}

.map-placeholder .small {
    font-size: 0.85rem;
}

/* ============================================
   Cards List
   ============================================ */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-tags {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-soft);
    color: var(--accent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.card-btn {
    flex: 1;
    background: var(--bg-primary);
    border: none;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.card-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.card-btn.navigate {
    background: var(--accent);
    color: white;
}

.card-btn.navigate:hover {
    background: var(--accent-light);
}

/* Filter Tags */
.filter-tags {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.tag-filter {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag-filter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tag-filter:hover:not(.active) {
    border-color: var(--accent);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

#modal-body {
    padding: var(--space-lg);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.tags-select {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.tag-option {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.tag-option.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.btn-secondary {
    flex: 1;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-save {
    flex: 2;
    background: var(--accent);
    color: white;
    border: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-save:hover {
    background: var(--accent-light);
}

/* ============================================
   Side Menu
   ============================================ */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: -5px 0 20px var(--shadow);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: var(--transition);
}

.side-menu:not(.hidden) {
    transform: translateX(0);
}

.menu-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--accent);
}

.menu-items {
    flex: 1;
    padding: var(--space-md);
}

.menu-item {
    width: 100%;
    background: none;
    border: none;
    padding: var(--space-md);
    text-align: right;
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.menu-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.menu-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

.menu-footer p {
    margin: var(--space-xs) 0;
}

.menu-footer .small {
    font-size: 0.85rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.empty-state p {
    margin: var(--space-sm) 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
    .views-container {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .phases-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #map-container {
        height: 400px;
    }
    
    .modal-content {
        max-width: 500px;
        margin: auto;
        border-radius: var(--radius-lg);
    }
}

/* ============================================
   Feeling Cards Special
   ============================================ */
.feeling-card {
    border-right: 4px solid var(--accent);
}

.feeling-card.happy {
    border-color: var(--success);
}

.feeling-card.free {
    border-color: var(--aurora-purple);
}

.feeling-card.thoughtful {
    border-color: var(--aurora-blue);
}

.feeling-card.love {
    border-color: #e91e63;
}

.feeling-mood {
    font-size: 1.5rem;
    margin-left: var(--space-sm);
}

/* ============================================
   Location Button
   ============================================ */
.get-location-btn {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px dashed var(--accent);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.get-location-btn:hover {
    background: var(--accent);
    color: white;
}

/* ============================================
   Print / Export Styles
   ============================================ */
@media print {
    .bottom-nav,
    .app-header,
    .btn-add,
    .card-actions {
        display: none !important;
    }
    
    .views-container {
        padding: 0;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* ============================================
   Budget Styles
   ============================================ */
.budget-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.budget-summary.three-cards {
    grid-template-columns: 1fr 1fr 1fr;
}

.budget-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.budget-card.budget-total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.budget-card.expenses-total {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.budget-card.remaining {
    background: var(--bg-card);
}

.budget-card.status-good {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.budget-card.status-warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #333;
}

.budget-card.status-negative {
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
    color: white;
}

.budget-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: var(--space-xs);
}

.budget-amount {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Expense toggle in spot form */
.expense-toggle-section {
    background: var(--accent-soft);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

#spot-expense-fields {
    background: var(--bg-primary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
}

#spot-expense-fields.hidden {
    display: none;
}

.expense-category-select {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.budget-info {
    background: var(--accent-soft);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.budget-info p {
    margin-bottom: var(--space-xs);
}

.budget-category {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
}

.expense-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.expense-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
}

.expense-details {
    flex: 1;
}

.expense-title {
    font-weight: 500;
    color: var(--text-primary);
}

.expense-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.expense-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

/* Image Preview */
.image-preview-container {
    margin-top: var(--space-md);
}

.image-preview {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
}

.image-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-lg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.image-upload-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

/* Currency input */
.currency-input {
    position: relative;
}

.currency-input input {
    padding-right: 40px;
}

.currency-symbol {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
}
