:root {
    --bg-color: #f9f9f5;
    --line-color: #e0e6ed;
    --margin-line: #ff9999;
    --text-main: #333333;
    --text-handwritten: #1a1a1a;
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --accent-color: #ffb347;
    --font-ui: 'Inter', sans-serif;
    --font-hand: 'Caveat', cursive;
}

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

body {
    background-color: #e8e8e8;
    font-family: var(--font-ui);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
}

.notebook-container {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 800px;
    min-height: 80vh;
    border-radius: 8px 16px 16px 8px;
    box-shadow: 
        10px 10px 20px rgba(0,0,0,0.1), 
        -2px 0 5px rgba(0,0,0,0.05),
        inset 5px 0 10px rgba(0,0,0,0.03); /* Binding shadow */
    position: relative;
    overflow: hidden;
    /* Notebook lined paper effect */
    background-image: linear-gradient(var(--line-color) 1px, transparent 1px);
    background-size: 100% 40px;
    background-position: 0 50px;
}

/* Notebook left margin line */
.notebook-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 60px;
    width: 2px;
    background-color: var(--margin-line);
    z-index: 1;
}

.notebook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px 20px 80px;
    position: relative;
    z-index: 2;
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--line-color);
}

.header-content h1 {
    font-family: var(--font-hand);
    font-size: 3rem;
    color: var(--primary-color);
    line-height: 1;
}

.header-content .subtitle {
    font-size: 0.9rem;
    color: #777;
    margin-top: 5px;
}

#auth-container {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.notebook-body {
    position: relative;
    z-index: 2;
    padding: 20px 40px 40px 80px;
}

.input-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#new-food-input {
    flex-grow: 1;
    border: none;
    font-family: var(--font-hand);
    font-size: 1.8rem;
    color: var(--text-handwritten);
    background: transparent;
    outline: none;
}

#new-food-input::placeholder {
    color: #bbb;
}

.btn {
    font-family: var(--font-ui);
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between lines */
}

/* Individual Food Entry */
.food-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 5px;
    height: 40px; /* Aligns with notebook background lines */
}

.food-name {
    font-family: var(--font-hand);
    font-size: 2rem;
    color: var(--text-handwritten);
}

/* Interaction Selector */
.interaction-selector {
    position: relative;
    user-select: none;
    font-family: var(--font-ui);
}

.current-stage {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
    font-size: 0.9rem;
    min-width: 140px;
}

.current-stage:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    border-color: #ccc;
}

.stage-icon {
    font-size: 1.2rem;
}

.stage-text {
    flex-grow: 1;
    font-weight: 600;
    color: #444;
}

.chevron {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s;
}

.current-stage.open .chevron {
    transform: rotate(180deg);
}

.stage-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    list-style: none;
    width: 200px;
    z-index: 10;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.stage-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.stage-dropdown li {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f0f0f0;
}

.stage-dropdown li:last-child {
    border-bottom: none;
}

.stage-dropdown li:hover {
    background-color: #f8f9fa;
}

.hidden {
    display: none !important;
}

/* Micro-animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.food-entry {
    animation: slideIn 0.3s ease forwards;
}

/* View Sections */
.view-section {
    width: 100%;
}

.view-section h2 {
    font-family: var(--font-hand);
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

.view-section p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* Dashboard Styles */
.participant-list {
    list-style: none;
    margin-bottom: 30px;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--line-color);
}

.participant-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.participant-item h3 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.participant-item .participant-meta {
    font-size: 0.9rem;
    color: #888;
}

.add-participant-form {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #ccc;
}

#new-participant-name {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: var(--font-ui);
}

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

.btn.secondary:hover {
    background-color: #f0f7ff;
}

/* Notebook Controls */
.notebook-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

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

.text-btn:hover {
    text-decoration: underline;
}

#current-participant-name {
    margin-bottom: 0;
    color: var(--primary-color);
}
