/* Google Fonts Import in Header handled */

:root {
    /* Color Palette - Premium Paper Feel */
    --bg-body: #F4F5F7; /* Light Grayish Blue - Paper like */
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    
    /* Primary Colors */
    --primary: #4A6FA5; /* Sophisticated Slate Blue */
    --primary-hover: #3E5D8A;
    --primary-light: #EBF1F7; /* Very light blue for backgrounds */
    
    /* Text Colors */
    --text-main: #2C3E50; /* Dark Blue-Gray */
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* Accents */
    --accent-gold: #C5A059; /* Muted Gold for premium feel */
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --info: #3B82F6;

    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    
    /* Transitions */
    --transition: all 0.25s ease;
    
    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Dark Mode Variables - Automatic based on data-theme attribute */
[data-theme="dark"] {
    --bg-body: #111827;
    --bg-card: #1F2937;
    --bg-sidebar: #1F2937;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-light: #6B7280;
    --primary: #60A5FA;
    --primary-light: rgba(96, 165, 250, 0.15);
    --accent-gold: #EAB308;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden; /* App Layout */
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.main-nav {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
    color: var(--primary);
}

.brand-icon {
    font-size: 2rem;
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.nav-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    scroll-behavior: smooth;
    position: relative;
}

/* Cards & Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-family: 'Inter', sans-serif; /* Cleaner headings for cards */
    font-weight: 600;
}

.card .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

/* Stats */
.stats-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-body) 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(0,0,0,0.05);
}

.btn-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.btn-fab:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-card);
}

/* Log Items */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.log-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.log-item:hover {
    background-color: var(--bg-body);
}

.log-item .symbol {
    min-width: 30px;
    font-weight: bold;
    color: var(--primary);
    margin-top: 2px;
}

.log-item.task { border-left-color: var(--primary); }
.log-item.event { border-left-color: var(--warning); }
.log-item.note { border-left-color: var(--text-muted); }
.log-item.completed_task { opacity: 0.6; text-decoration: line-through; border-left-color: var(--success); }

.log-item .content {
    flex: 1;
}

.log-item .actions {
    opacity: 0;
    transition: var(--transition);
    display: flex;
    gap: 0.25rem;
}

.log-item:hover .actions {
    opacity: 1;
}

/* Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    border-left: 4px solid var(--primary);
}

.flash-message.success { border-left-color: var(--success); }
.flash-message.error { border-left-color: var(--danger); }

/* Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .main-nav {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        position: fixed;
        bottom: 0;
        left: 0;
        background-color: var(--bg-card);
        border-right: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        align-items: center;
    }

    .nav-brand, .nav-label {
        display: none;
    }
    
    .nav-footer {
        border-top: none;
        padding-top: 0;
    }

    .nav-links {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    .nav-item {
        padding: 0.5rem;
        border-radius: 50%;
    }
    
    .main-content {
        padding: 1rem;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    .btn-fab {
        bottom: 5rem;
        right: 1.5rem;
    }
}
