* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #510b06c7;
    --surface: #151517;
    --surface-2: #1d1d20;
    --border: #29292d;
    --text: #de6915;
    --muted: #929298;
    --accent: #eff2ef;
    --danger: #f7f1f1;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overscroll-behavior: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    margin: auto;
    padding: 0 16px 110px;
}


/* TOPBAR */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 20px;
}

.small-title {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    margin-bottom: 5px;
}

h1 {
    font-size: 25px;
    margin: 0;
    font-weight: 700;
}

.add-header {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--surface-2);
    color: white;
    font-size: 29px;
    line-height: 1;
}


/* SEARCH */

.search-box {
    margin-bottom: 14px;
}

.search-box input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: rgb(217, 20, 20);
    padding: 0 15px;
    outline: none;
}

.search-box input:focus {
    border-color: #10109a;
}

.search-box input::placeholder {
    color: #979695;
}


/* TODAY */

.today-card {
    padding: 18px;
    border-radius: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 27px;
}

.today-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 7px;
}

#todayText {
    font-size: 15px;
    font-weight: 600;
}


/* SECTION */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
}

.section-header h2 {
    font-size: 16px;
    margin: 0;
}

.section-header span {
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--muted);
    border-radius: 8px;
    font-size: 11px;
}

.past-header {
    margin-top: 30px;
}


/* APPOINTMENTS */

.appointments {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.appointment {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    transition: transform 0.15s ease;
}

.appointment:active {
    transform: scale(0.985);
}

.appointment-top {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.date-box {
    flex-shrink: 0;
    width: 49px;
    height: 53px;
    border-radius: 12px;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.date-day {
    font-size: 19px;
    font-weight: 700;
}

.date-month {
    font-size: 9px;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.appointment-info {
    flex: 1;
    min-width: 0;
}

.appointment-title {
    font-size: 16px;
    font-weight: 700;
    margin: 1px 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-time {
    font-size: 13px;
    color: #f7f7fc;
}

.appointment-location {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-note {
    border-top: 1px solid var(--border);
    margin-top: 13px;
    padding-top: 11px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.more-button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #f10909;
    font-size: 22px;
    border-radius: 9px;
}

.more-button:active {
    background: var(--surface-2);
}

.past .appointment-title,
.past .appointment-time {
    color: #59595e;
}

.empty {
    padding: 25px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}


/* FLOATING BUTTON */

.floating-button {
    position: fixed;
    z-index: 10;
    right: max(20px, calc((100vw - 520px) / 2 + 20px));
    bottom: 24px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 18px;
    background: rgb(232, 129, 11);
    color: rgb(226, 9, 9);
    font-size: 32px;
    box-shadow: 0 8px 30px rgba(244, 14, 6, 0.742);
}


/* MODAL */

.modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(67, 3, 3, 0.72);
    padding: 0;
}

.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    background: #919193;
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 22px 17px 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.close-button {
    border: 0;
    background: var(--surface-2);
    color: rgb(243, 9, 9);
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 25px;
}


/* FORM */

form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #e53d0e;
    font-size: 12px;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: rgb(239, 7, 7);
    outline: none;
}

label input {
    height: 49px;
    padding: 0 13px;
}

textarea {
    min-height: 110px;
    padding: 13px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: #ea0b0b;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}

.save-button {
    margin-top: 3px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 13px;
    background: rgb(244, 134, 8);
    color: black;
    font-size: 15px;
    font-weight: 700;
}


/* ACTION SHEET */

.action-sheet {
    width: 100%;
    max-width: 520px;
    background: #0b0a0a;
    border-radius: 22px 22px 0 0;
    padding: 10px 12px 25px;
}

.action-sheet button {
    display: block;
    width: 100%;
    height: 52px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: rgb(249, 8, 8);
    text-align: left;
    padding: 0 12px;
}

.action-sheet button:last-child {
    border-bottom: 0;
}

.action-sheet .delete-action {
    color: var(--danger);
}


/* TOAST */

.toast {
    position: fixed;
    z-index: 200;
    left: 50%;
    bottom: 94px;
    transform: translate(-50%, 20px);
    background: #e70505;
    color: #111;
    padding: 11px 17px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}


/* MOBILE */

@media (max-width: 380px) {

    .app {
        padding-left: 12px;
        padding-right: 12px;
    }

    h1 {
        font-size: 22px;
    }

    .appointment {
        padding: 13px;
    }

    .date-box {
        width: 45px;
    }

}