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

:root {
    --background: #0b0b0f;
    --surface: #15151b;
    --surface-light: #1d1d25;
    --border: #292933;
    --text: #f5f5f7;
    --muted: #92929d;
    --accent: #ffffff;
    --danger: #ff5c5c;
}

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}


/* AUTH */

.auth-view {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    padding: 40px;

    text-align: center;
}

.auth-card h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 30px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

input,
textarea {
    width: 100%;

    background: var(--surface-light);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 14px;

    font-size: 15px;

    outline: none;
}

input:focus,
textarea:focus {
    border-color: #555563;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

button {
    border: none;
    border-radius: 10px;

    padding: 13px 18px;

    background: var(--accent);
    color: #000;

    font-weight: 600;

    cursor: pointer;

    transition: 0.2s;
}

button:hover {
    opacity: 0.85;
}

.error {
    color: var(--danger);
    margin-top: 15px;
    min-height: 20px;
}


/* TOPBAR */

.topbar {
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    border-bottom: 1px solid var(--border);

    background: var(--surface);
}

.topbar h1 {
    font-size: 22px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-area span {
    color: var(--muted);
}


/* CALENDAR */

.calendar-container {
    max-width: 1200px;

    margin: 40px auto;

    padding: 0 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 30px;

    margin-bottom: 25px;
}

.calendar-header h2 {
    min-width: 220px;

    text-align: center;

    font-size: 24px;
}

.calendar-header button {
    width: 42px;
    height: 42px;

    padding: 0;

    background: var(--surface-light);
    color: var(--text);

    border: 1px solid var(--border);

    font-size: 24px;
}


/* WEEKDAYS */

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);

    margin-bottom: 8px;
}

.weekdays div {
    text-align: center;

    color: var(--muted);

    font-size: 13px;
    font-weight: 600;

    padding: 10px;
}


/* CALENDAR GRID */

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

    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);

    border-radius: 12px;
    overflow: hidden;
}

.calendar-day {
    min-height: 110px;

    padding: 12px;

    background: var(--surface);

    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    cursor: pointer;

    position: relative;

    transition: background 0.2s;
}

.calendar-day:hover {
    background: var(--surface-light);
}

.calendar-day.other-month {
    color: #4d4d57;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--text);
}

.calendar-day.selected {
    background: #25252e;
}

.day-number {
    font-size: 14px;
    font-weight: 600;
}

.note-indicator {
    position: absolute;

    bottom: 10px;
    left: 12px;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: white;
}


/* NOTES */

.notes-section {
    margin-top: 35px;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.notes-header h2 {
    font-size: 21px;
}

#notesList {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.note {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 18px;
}

.note h3 {
    margin-bottom: 8px;
}

.note p {
    color: var(--muted);

    line-height: 1.5;

    white-space: pre-wrap;
}

.note-actions {
    display: flex;
    gap: 8px;

    margin-top: 15px;
}

.note-actions button {
    background: var(--surface-light);
    color: var(--text);

    border: 1px solid var(--border);

    padding: 8px 12px;
}

.empty {
    color: var(--muted);

    padding: 30px 0;
}


/* MODAL */

.modal {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.75);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 100;
}

.modal-content {
    width: 100%;
    max-width: 500px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 16px;

    padding: 25px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 20px;
}

.modal-header button {
    background: transparent;
    color: var(--text);

    font-size: 28px;

    padding: 0 8px;
}


/* UTILITY */

.hidden {
    display: none !important;
}


/* MOBILE */

@media (max-width: 700px) {

    .topbar {
        padding: 0 15px;
    }

    .calendar-container {
        margin-top: 20px;
        padding: 0 10px;
    }

    .calendar-day {
        min-height: 70px;
        padding: 8px;
    }

    .day-number {
        font-size: 12px;
    }

    .calendar-header {
        gap: 10px;
    }

    .calendar-header h2 {
        min-width: 170px;
        font-size: 19px;
    }

    .notes-header {
        gap: 10px;
    }

    .notes-header button {
        font-size: 12px;
        padding: 10px;
    }
}

/* =========================================
   MOBILE / RESPONSIVE
   ========================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    overflow-x: hidden;
}

/* Tablet */
@media (max-width: 900px) {

    .calendar-container,
    .calendar,
    .app-container,
    .main-container {
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        width: 220px;
    }
}


/* =========================================
   HANDY
   ========================================= */

@media (max-width: 600px) {

    body {
        font-size: 15px;
    }

    /* Hauptcontainer */

    .app-container,
    .main-container,
    .calendar-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px;
    }


    /* =====================================
       HEADER
       ===================================== */

    header {
        padding: 12px 14px;
    }

    header h1 {
        font-size: 20px;
    }

    header p {
        font-size: 13px;
    }


    /* =====================================
       KALENDER
       ===================================== */

    .calendar {
        width: 100%;
        overflow: hidden;
    }

    .calendar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 12px;
    }

    .calendar-header h2 {
        font-size: 18px;
        margin: 0;
    }

    .calendar-header button {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }


    /* Wochentage */

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

    .weekday {
        font-size: 11px;
        text-align: center;
        padding: 6px 0;
    }


    /* Tage */

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

    .calendar-day {
        min-height: 48px;
        padding: 5px;
        border-radius: 8px;
        font-size: 13px;
    }

    .calendar-day .day-number {
        font-size: 13px;
    }


    /* =====================================
       NOTIZEN
       ===================================== */

    .notes {
        width: 100%;
        margin-top: 15px;
    }

    .note {
        width: 100%;
        padding: 14px;
        border-radius: 12px;
    }

    .note-title {
        font-size: 16px;
    }

    .note-content {
        font-size: 14px;
        line-height: 1.5;
    }


    /* =====================================
       INPUTS
       ===================================== */

    input,
    textarea,
    select {
        width: 100%;
        max-width: 100%;
        font-size: 16px;
        padding: 12px;
        border-radius: 10px;
    }

    textarea {
        min-height: 120px;
        resize: vertical;
    }


    /* =====================================
       BUTTONS
       ===================================== */

    button {
        min-height: 44px;
        font-size: 15px;
        border-radius: 10px;
    }

    .button-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .button-row button {
        width: 100%;
    }


    /* =====================================
       SIDEBAR
       ===================================== */

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.25s ease;
    }

    .sidebar.open {
        left: 0;
    }


    /* =====================================
       MODAL
       ===================================== */

    .modal {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px;
        padding: 18px;
        border-radius: 16px;
    }


    /* =====================================
       LOGIN / REGISTER
       ===================================== */

    .auth-container {
        width: 100%;
        min-height: 100vh;
        padding: 20px 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .auth-box {
        width: 100%;
        max-width: 420px;
        padding: 22px 18px;
        border-radius: 16px;
    }

    .auth-box h1 {
        font-size: 24px;
    }

    .auth-box button {
        width: 100%;
    }
}


/* =========================================
   SEHR KLEINE HANDYS
   ========================================= */

@media (max-width: 380px) {

    .app-container,
    .main-container,
    .calendar-container {
        padding: 8px;
    }

    .calendar-day {
        min-height: 42px;
        padding: 3px;
        font-size: 12px;
    }

    .calendar-day .day-number {
        font-size: 12px;
    }

    .weekday {
        font-size: 10px;
    }

    .calendar-header h2 {
        font-size: 16px;
    }
}

/* =========================================
   IMPORTANT / REMINDER
   ========================================= */

.note.important {
    border-color: #d6a800;
    box-shadow: inset 4px 0 0 #d6a800;
}

.note.important h3::before {
    content: "Wichtig · ";
    color: #d6a800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.note-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 5px 9px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--muted);
    font-size: 12px;
}

.note-badge.important-badge {
    color: #f0c419;
    border-color: #7a6200;
}

.note-badge.alert-badge {
    color: #7cc7ff;
    border-color: #315b78;
}

.note-badge.sent-badge {
    color: #8ee3a2;
    border-color: #356d43;
}


/* =========================================
   NOTE FORM OPTIONS
   ========================================= */

.note-options {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin: 5px 0 15px;
    padding: 15px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.option-text strong {
    font-size: 14px;
}

.option-text span {
    color: var(--muted);
    font-size: 12px;
}


/* Toggle */

.switch {
    position: relative;

    width: 46px;
    height: 26px;

    flex-shrink: 0;
}

.switch input {
    position: absolute;

    width: 0;
    height: 0;

    opacity: 0;
}

.slider {
    position: absolute;
    inset: 0;

    background: #3a3a45;
    border: 1px solid var(--border);
    border-radius: 999px;

    cursor: pointer;
    transition: 0.2s;
}

.slider::before {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    left: 3px;
    top: 3px;

    background: white;
    border-radius: 50%;

    transition: 0.2s;
}

.switch input:checked + .slider {
    background: #ffffff;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #111;
}


/* Reminder-Feld */

.reminder-field {
    display: flex;
    flex-direction: column;
    gap: 7px;

    margin-top: 5px;
}

.reminder-field label {
    color: var(--muted);
    font-size: 13px;
}

.reminder-field input {
    min-height: 44px;
}


/* Kalender-Indikatoren */

.note-indicator.important-indicator {
    background: #f0c419;
}

.note-indicator.alert-indicator {
    left: 24px;
    background: #7cc7ff;
}


/* =========================================
   MOBILE REMINDER / IMPORTANT
   ========================================= */

@media (max-width: 600px) {

    .note-options {
        padding: 12px;
    }

    .option-row {
        align-items: flex-start;
    }

    .option-text strong {
        font-size: 13px;
    }

    .note-meta {
        gap: 6px;
    }

    .note-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

}