:root {
    --bg-color: #f3f4f6;
    --primary-color: #fcd34d;
    /* Yellow note color */
    --primary-dark: #fbbf24;
    --text-color: #374151;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Auth Pages */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e5e7eb;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-container h2 {
    margin-bottom: 25px;
    font-family: 'Nanum Pen Script', cursive;
    font-size: 3rem;
    color: #f59e0b;
}

.auth-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.auth-link {
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-link a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: bold;
}

/* Main Layout */
.main-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 2.5rem;
    color: #f59e0b;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-greeting {
    color: #6b7280;
}

.btn-new-memo {
    background-color: var(--primary-color);
    color: #374151;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-new-memo:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-logout {
    margin-left: 10px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: #ef4444;
}

/* Memo Grid */
.memo-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.memo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.memo-card {
    background-color: white;
    /* 기본 흰색 배경 */
    padding: 25px;
    border-radius: 2px;
    /* 포스트잇 같은 약간 둥근 모서리 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 280px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-top: 5px solid var(--primary-color);
    /* 상단 노란 포인트 */
}

/* 카드 색상 다양화 (nth-child 사용) */
.memo-card:nth-child(3n+1) {
    border-top-color: #fcd34d;
}

/* 노랑 */
.memo-card:nth-child(3n+2) {
    border-top-color: #6ee7b7;
}

/* 초록 */
.memo-card:nth-child(3n+3) {
    border-top-color: #93c5fd;
}

/* 파랑 */

.memo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.memo-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memo-content {
    color: #4b5563;
    font-size: 0.95rem;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    white-space: pre-wrap;
}

.memo-date {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: right;
}

.empty-state {
    text-align: center;
    margin-top: 100px;
    color: #9ca3af;
}

.btn-start {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

/* Write & View Page */
.write-body,
.view-body {
    background-color: #f9fafb;
}

.write-container,
.view-container {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    min-height: 80vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    padding: 40px;
    position: relative;
}

.write-header,
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 20px;
}

.btn-close,
.btn-back {
    font-size: 1.5rem;
    text-decoration: none;
    color: #9ca3af;
}

.write-form {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
}

.input-title {
    font-size: 2rem;
    border: none;
    outline: none;
    width: 100%;
    margin-bottom: 20px;
    font-weight: bold;
}

.input-content {
    font-size: 1.1rem;
    border: none;
    outline: none;
    resize: none;
    flex-grow: 1;
    line-height: 1.8;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-save {
    padding: 10px 30px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel {
    padding: 10px 20px;
    background-color: #e5e7eb;
    text-decoration: none;
    color: #4b5563;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

/* View Page Specific */
.view-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.view-meta {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 30px;
}

.view-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    white-space: pre-wrap;
}

.view-actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-edit {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-delete {
    background-color: #fee2e2;
    color: #ef4444;
}