/* ============================================================
   AbbieOnCall - app.abbieoncall.com
   Main Stylesheet
   Adapted from StoryDrafts shared shell
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-y: scroll; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background-color: #eef0f2;
    color: #2c3e50;
    min-height: 100vh;
}

body.night-mode {
    background-color: #1a1d23;
    color: #d0d4dc;
}

/* --- Page Wrapper ----------------------------------------- */
.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
}

/* --- Card ------------------------------------------------- */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 1024px;
    overflow: hidden;
}

.night-mode .card {
    background: #23272f;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Keep all pages the same consistent width */
.card.card-wide {
    max-width: 1024px;
}

/* --- Card Header (nav bar) -------------------------------- */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e8eaed;
}

.night-mode .card-header {
    border-bottom-color: #383d47;
}

.card-header .nav-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.card-header .home-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #3d9bd4;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.card-header .home-link:hover { color: #2a7db5; }

.card-header .nav-link {
    color: #3d9bd4;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
}

.card-header .nav-link:hover { color: #2a7db5; }

.card-header .nav-link.active {
    color: #2c3e50;
    font-weight: 600;
}

.night-mode .card-header .nav-link.active { color: #d0d4dc; }

/* --- Night Mode Toggle ------------------------------------ */
.night-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
}

.night-mode .night-toggle { color: #b0b8c4; }

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input:checked + .toggle-slider { background-color: #3d9bd4; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* --- Card Body -------------------------------------------- */
.card-body {
    padding: 40px 32px;
}

/* --- Page Title ------------------------------------------- */
.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.night-mode .page-title { color: #e8eaed; }

.page-subtitle {
    font-size: 1.4rem;
    color: #555;
    margin-bottom: 32px;
}

.night-mode .page-subtitle { color: #b0b8c4; }

/* --- Primary Button --------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background-color: #3d9bd4;
    color: #ffffff;
    width: 80%;
    padding: 16px;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn-primary:hover { background-color: #2a7db5; }

.btn-secondary {
    background-color: #f0f2f5;
    color: #2c3e50;
}

.btn-secondary:hover { background-color: #e2e5e9; }

.btn-danger {
    background-color: #e74c3c;
    color: #ffffff;
}

.btn-danger:hover { background-color: #c0392b; }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.night-mode .btn-secondary {
    background-color: #383d47;
    color: #d0d4dc;
}

/* --- Modals ----------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    animation: modal-in 0.2s ease;
}

.night-mode .modal {
    background: #23272f;
    color: #d0d4dc;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal h3 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e50;
}

.night-mode .modal h3 { color: #e8eaed; }

.modal-body { margin-bottom: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Form Fields ------------------------------------------ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.night-mode .form-group label { color: #a0a8b4; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #2c3e50;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3d9bd4;
}

.night-mode .form-group input,
.night-mode .form-group select,
.night-mode .form-group textarea {
    background: #1e2228;
    border-color: #383d47;
    color: #d0d4dc;
}

/* --- Utility --------------------------------------------- */
.text-muted  { color: #95a5a6; font-size: 0.85rem; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.text-center { text-align: center; }
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #7f8c8d;
}
.empty-state p { font-size: 1.2rem; margin-bottom: 16px; }

/* --- Help Tip — opens left -------------------------------- */
.help-tip.tip-left .tip-text {
    left: auto;
    right: 26px;
}
.help-tip.tip-left .tip-text::before {
    left: auto;
    right: -6px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #2c3e50;
}
