:root {
    --bg-color: #0d0d0d;
    --card-bg: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --danger: #ff4d4d;
    --border: #333;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.6;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.brand {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Forms */
input,
textarea {
    width: 100%;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--accent-dim);
}

/* To-Do List */
.todo-container {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 35px;
    /* Increased from 20px */
    border: 1px solid var(--border);
}

.todo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.todo-input-group input {
    color: white;
    /* Fix invisible text */
    flex: 1;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.todo-item.done span {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.todo-check {
    margin-right: 10px;
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

.todo-del {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

/* Card Actions */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 2px;
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.edit-btn:hover {
    color: var(--accent);
}

.delete-btn:hover {
    color: var(--danger);
}

/* Search & Filter */
.search-container {
    margin-top: 10px;
    margin-bottom: 15px;
    position: relative;
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.chip {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: bold;
}

/* Entry Badges & Actions */
.entry-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #333;
    color: #fff;
    margin-left: 8px;
    text-transform: uppercase;
}

.badge-log {
    background: #007bff;
}

.badge-arahan {
    background: #ffc107;
    color: #000;
}

.badge-materi {
    background: #28a745;
}

.badge-kendala {
    background: #dc3545;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    opacity: 0.6;
}

.delete-btn:hover {
    color: var(--danger);
    opacity: 1;
}

/* Timeline / Cards */
.entry-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    position: relative;
    transition: transform 0.2s;
}

.entry-card:active {
    transform: scale(0.98);
}

.entry-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-right: 60px;
    /* Space for action buttons */
    align-items: center;
}

.entry-type-icon {
    font-size: 1.1rem;
}

.entry-content {
    margin-bottom: 10px;
    white-space: pre-wrap;
}

audio {
    width: 100%;
    margin-top: 10px;
    height: 40px;
    filter: invert(1) hue-rotate(180deg);
    /* Dark mode style */
}

/* Image preview in feed */
.entry-image {
    width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    object-fit: cover;
    max-height: 300px;
}

/* Bottom Nav / Quick Actions */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    z-index: 100;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    text-align: center;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

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

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    display: block;
}

/* Modal for New Entry */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-modal {
    background: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 0;
}

/* Recording UI */
.recording-ui {
    text-align: center;
    padding: 20px;
}

.mic-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 4px solid #3d1a1a;
    transition: all 0.2s;
}

.mic-button.recording {
    animation: pulse 1.5s infinite;
    background: #ff0000;
    border-color: #ffcccc;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(255, 77, 77, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
    }
}

.timer {
    font-size: 2rem;
    font-family: monospace;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    width: 90%;
    max-width: 350px;
    border: 1px solid var(--border);
}

.login-box input {
    font-size: 1.5rem;
    letter-spacing: 5px;
    text-align: center;
    margin: 20px 0;
    width: 100%;
    background: #000;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
}