/* RESET & BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212; /* Dark Theme */
    color: #e0e0e0;
    overscroll-behavior-y: none;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* UTILITIES */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* HEADER */
.app-header {
    background-color: #000000; /* Black Header */
    color: #ffffff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid #333;
}

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

.app-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px; /* Optional: adds slight curve to icon */
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* BUTTONS */
.btn-icon {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-icon:active {
    background-color: #333;
}

.btn-save {
    color: #3b82f6; /* Blue */
}

/* MAIN CONTENT */
.page-content {
    margin-top: 60px; /* Header height */
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px; /* Space for FAB */
}

/* HOME PAGE LIST */
.note-card {
    background-color: #1e1e1e;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.note-card:active {
    transform: scale(0.98);
    background-color: #252525;
}

.note-card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 30px; /* Space for delete btn */
}

.note-card p {
    font-size: 0.9rem;
    color: #a3a3a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    padding: 4px;
    line-height: 1;
}

/* EDITOR STYLES */
.input-title {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    outline: none;
    margin-bottom: 8px;
}

.divider {
    border: 0;
    border-top: 1px solid #404040;
    margin-bottom: 16px;
}

.input-body {
    width: 100%;
    height: 70vh;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 16px; /* 16px Fixed */
    line-height: 1.5;
    outline: none;
    resize: none;
}

/* CHECKLIST STYLES */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    animation: fadeIn 0.2s;
}

.checkbox {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
}

.input-line {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #404040;
    color: #ddd;
    padding: 8px 0;
    font-size: 16px;
    outline: none;
}

.input-line:focus {
    border-bottom-color: #3b82f6;
}

.btn-add-item {
    color: #60a5fa;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-top: 16px;
    cursor: pointer;
}

/* FAB (Floating Action Button) */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: none;
    cursor: pointer;
    z-index: 200;
}

.fab:active {
    transform: scale(0.95);
}

/* BOTTOM SHEET */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1e1e1e;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 24px;
    z-index: 301;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid #333;
}
.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.sheet-btn {
    background-color: #2a2a2a;
    border: none;
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sheet-btn:active {
    background-color: #333;
}

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