/* used chatGPT to improve CSS */
* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --blue: #2563eb;
    --green: #22c55e;
    --red: #ef4444;
    --graybtn: #e5e7eb;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 28px;
}

/* ---------- Landing page --------- */
#title {
    margin: 0 0 6px 0;
    font-size: 30px;
    letter-spacing: -0.02em;
}

#subtitle {
    margin: 0 0 18px 0;
    color: var(--muted);
    font-weight: 600;
}

#buttonContainer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#writerButton,
#readerButton {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow);
}

#writerButton {
    background: var(--blue);
}

#readerButton {
    background: #64748b;
}

#writerButton:hover,
#readerButton:hover {
    filter: brightness(0.95);
}

/* ---------- Writer/Reader ---------- */

#notesList {
    width: min(900px, 96vw);
    margin: 70px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.updateTime {
    position: fixed;
    top: 14px;
    right: 18px;
    background: #111827;
    color: #fff;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow);
    opacity: 0.95;
}

.note {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
}


.noteContainer {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 14px;
    min-height: 86px;
    line-height: 1.4;
    white-space: pre-wrap;
    box-shadow: var(--shadow);
    outline: none;
}


.noteContainer[contenteditable="true"]:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), var(--shadow);
}


.removeButton {
    height: 42px;
    padding: 10px 14px;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    background: var(--red);
    color: #fff;
    box-shadow: var(--shadow);
}

.removeButton:hover {
    filter: brightness(0.95);
}

.removeButton:active {
    transform: translateY(1px);
}


#addNoteButton,
#homeButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
}


#addNoteButton {
    margin: 16px auto 0 auto;
    background: var(--green);
    color: #fff;
}

#homeButton {
    margin: 12px auto 0 auto;
    background: var(--graybtn);
    color: #111827;
}

#addNoteButton:hover,
#homeButton:hover {
    filter: brightness(0.97);
}

#addNoteButton:active,
#homeButton:active {
    transform: translateY(1px);
}