:root {
    --primary-color: #ff85a2;
    --primary-hover: #ff6b8e;
    --user-me-color: #6b8cff;
    --user-gf-color: #ff85a2;
    --secondary-color: #f0f2f5;
    --bg-color: #fff9fa;
    --app-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #888888;
    --border-color: #ffeeee;
    --sunday-color: #ff5e5e;
    --saturday-color: #5e7eff;
    --card-shadow: 0 4px 20px rgba(255, 133, 162, 0.1);
    --modal-bg: rgba(0, 0, 0, 0.5);
    --input-bg: #ffffff;
    --border-radius: 16px;
}

[data-theme="dark"] {
    --primary-color: #ff7096;
    --primary-hover: #ff4d7d;
    --user-me-color: #829fff;
    --user-gf-color: #ff7096;
    --secondary-color: #2d2d2d;
    --bg-color: #1a1a1a;
    --app-bg: #242424;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --sunday-color: #ff6b6b;
    --saturday-color: #6b8cff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --modal-bg: rgba(0, 0, 0, 0.7);
    --input-bg: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

body {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 500px;
    background: var(--app-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--card-shadow);
}

header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.current-month {
    font-size: 0.95rem;
    font-weight: 600;
}

/* D-Day Board */
.d-day-board {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    background: linear-gradient(to bottom, rgba(255,133,162,0.05), transparent);
}

.d-day-card {
    background: var(--app-bg);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
}

.edit-icon {
    font-size: 0.7rem;
    margin-left: 4px;
    font-style: normal;
    opacity: 0.6;
}

.hidden-date-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.d-day-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.d-day-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

main {
    flex: 1;
    padding: 16px;
}

.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.weekday-header span:first-child { color: var(--sunday-color); }
.weekday-header span:last-child { color: var(--saturday-color); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    min-height: 80px;
    padding: 4px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background-color: var(--secondary-color);
}

.calendar-day.today {
    background-color: rgba(255, 133, 162, 0.05);
    border: 1px solid var(--primary-color);
}

.calendar-day.today span:first-child {
    font-weight: 800;
    color: var(--primary-color);
}

.calendar-day.other-month {
    opacity: 0.3;
}

/* Event Bar Style */
.event-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    width: 100%;
}

.event-bar {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.event-bar.me { background-color: var(--user-me-color); }
.event-bar.gf { background-color: var(--user-gf-color); }

.fab {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 28px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 133, 162, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Modal UI Improvement */
.author-select {
    margin-bottom: 16px;
}

.author-select label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-color);
}

.date-range {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.date-range .input-group {
    flex: 1;
}

.input-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.modal-content {
    background: var(--app-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
}

.modal-body input[type="text"], .modal-body input[type="date"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    outline: none;
    font-family: inherit;
}

.modal.hidden { display: none; }
.hidden { display: none !important; }

/* ... (나머지 모달/댓글 스타일 동일) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.btn-delete {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.comments-section h4 {
    margin: 12px 0 8px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.comments-list {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comment-item {
    font-size: 0.8rem;
    padding: 6px 10px;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 6px;
}

.comment-input-group {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 0 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

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

hr { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }
