/* Global / Head styles */
html {
    box-sizing: border-box;
    font-size: 16px;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: #181716;
    color: #f5f5f5;
    margin: 0;
    padding: 0;
    /* make the document a column flex container so footer can stick to bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
header {
    background: #22201e;
    color: #fff;
    padding: 2.2rem 1rem 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 16px rgba(60,40,20,0.13);
}
header h1 {
    margin: 0;
    font-size: 2.1rem;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: #ffe0b2;
}
/* Top row in header moved from inline styles in index.html */
.top-row {
    position: relative;
    padding: 0.8rem 0;
}
.top-row .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.top-row #appTitle { margin-right: 0.5rem; }

/* Move inline styles for controls into CSS */
.top-row #langSelect {
    position: absolute;
    left: 1rem;
    /* preserved inline tweak originally in HTML */
    top: -2.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.08);
}
.top-row #notificationBtn {
    position: absolute;
    right: 6rem;
    top: -2.4rem;
    background: #fff3e0;
    color: #3e2723;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.top-row #notificationBtn:hover {
    background: #ffe0b2;
    transform: scale(1.05);
}
.top-row #notificationBtn:active {
    transform: scale(0.95);
}
.top-row #logoutBtn {
    position: absolute;
    right: 1rem;
    top: -2.4rem;
    background: #ffccbc;
    color: #3e2723;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-weight: 700;
    cursor: pointer;
}
.top-row #addBtn {
    background: #ffe0b2;
    color: #3e2723;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(60,40,20,0.13);
    display: flex;
    align-items: center;
    justify-content: center;
}
header p {
    margin: 0.7rem 0 0 0;
    color: #bdbdbd;
    font-size: 1.1rem;
}
@media (min-width: 600px) {
    header {
        padding: 3rem 1rem 2rem 1rem;
    }
    header h1 {
        font-size: 2.7rem;
    }
}

/* Language selector (top-left) and logout (top-right) positioning */
#langSelect {
    position: absolute;
    left: 1rem;
    top: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    background: rgba(255,224,178,0.15);
    border: 1px solid rgba(255,224,178,0.3);
    color: #ffe0b2;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}
#langSelect:hover {
    background: rgba(255,224,178,0.25);
    border-color: rgba(255,224,178,0.5);
}
#langSelect option {
    background: #3e2723;
    color: #ffe0b2;
}

#logoutBtn {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

/* Make header positioning responsive on small screens */
@media (max-width: 600px) {
    header {
        padding: 1.4rem 0.8rem 1rem 0.8rem;
    }
    /* Keep language selector and logout button at the top on mobile so they remain reachable */
    header #langSelect, header #logoutBtn {
        position: absolute;
        display: inline-block;
        top: 0.25rem; /* raised a bit more from previous 0.5rem */
    }
    header #langSelect { left: 1rem; }
    header #logoutBtn { right: 1rem; }

    /* Push title and add button down so top controls are not overlapped */
    header > div {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        margin-top: 2.6rem;
    }
    /* Slightly increase select font-size for clarity on small screens (use existing selector rules) */
}

/* Slightly larger select on wider screens for better readability */
@media (min-width: 900px) {
    #langSelect { font-size: 1rem; }
}

/* Modal input styles */
#modalAdd .input-modal, #modalAdd input[name="nombre"],
#modalEdit .input-modal, #modalEdit input[name="nombre"],
#modalEditCategory .input-modal, #modalEditPlace .input-modal,
.modal-content-reminders .input-modal {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.7rem;
    border: none;
    margin-top: 0.2rem;
    font-size: 1rem;
    background: #fff;
    color: #23201e;
    box-shadow: 0 2px 8px rgba(60,40,20,0.07);
    outline: none;
    transition: box-shadow 0.2s;
}
#modalAdd .input-modal:focus, #modalAdd input[name="nombre"]:focus,
#modalEdit .input-modal:focus, #modalEdit input[name="nombre"]:focus,
#modalEditCategory .input-modal:focus, #modalEditPlace .input-modal:focus,
.modal-content-reminders .input-modal:focus {
    box-shadow: 0 4px 16px rgba(60,40,20,0.13);
}
#modalAdd select.input-modal, #modalEdit select.input-modal {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%233e2723" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    padding-right: 2.2em;
    cursor: pointer;
}
#modalAdd input[type="file"].input-modal, #modalEdit input[type="file"].input-modal {
    background: #fff;
    color: #23201e;
    border: none;
    padding: 0.5rem 0.2rem;
    font-size: 1rem;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(60,40,20,0.07);
}

/* Modal wrapper and form moved from inline styles in index.html */
#modalAdd, #modalEdit, #modalEditCategory, #modalEditPlace, #modalReminders {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(24,23,22,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Add `.open` when modal should be visible (JS toggles this) */
#modalAdd.open, #modalEdit.open, #modalEditCategory.open, #modalEditPlace.open, #modalReminders.open { display: flex; }

#addForm, #editForm, #editCategoryForm, #editPlaceForm, .modal-content-reminders {
    background: #23201e;
    color: #fff;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    min-width: 270px;
    max-width: 95vw;
    max-height: 90vh;
    box-shadow: 0 8px 48px rgba(60,40,20,0.28);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: relative;
    overflow-y: auto;
}

#closeModal, #closeEditModal, #closeEditCategoryModal, #closeEditPlaceModal, #closeRemindersModal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #ffe0b2;
    font-size: 1.5rem;
    cursor: pointer;
    width: auto;
    padding: 0;
}

#modalTitle, #editModalTitle, #editCategoryModalTitle, #editPlaceModalTitle, #remindersModalTitle {
    margin: 0 0 1rem 0;
    color: #ffe0b2;
    font-size: 1.3rem;
}

.modal-field { margin-bottom: 0.2rem; display:flex; flex-direction:column; }
.modal-field label {
    color: #ffe0b2;
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.select-row { display:flex; align-items:center; gap:0.5rem; }
.input-wrap { display:none; margin-top:0.5rem; align-items:center; gap:0.5rem; }

/* Buttons within the modal */
#addForm button[type="button"],
#addForm button[type="submit"],
#editForm button[type="button"],
#editForm button[type="submit"],
#editCategoryForm button[type="button"],
#editPlaceForm button[type="button"],
.modal-content-reminders button[type="button"] {
    background: #ffe0b2;
    color: #3e2723;
    border: none;
    border-radius: 1rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#addForm button[type="button"]:hover,
#addForm button[type="submit"]:hover,
#editForm button[type="button"]:hover,
#editForm button[type="submit"]:hover,
#editCategoryForm button[type="button"]:hover,
#editPlaceForm button[type="button"]:hover,
.modal-content-reminders button[type="button"]:hover {
    background: #ffd699;
    transform: translateY(-1px);
}

#addForm button[type="button"]:active,
#addForm button[type="submit"]:active,
#editForm button[type="button"]:active,
#editForm button[type="submit"]:active,
#editCategoryForm button[type="button"]:active,
#editPlaceForm button[type="button"]:active {
    transform: translateY(0);
}

#addForm button[type="button"]:disabled,
#addForm button[type="submit"]:disabled,
#editForm button[type="button"]:disabled,
#editForm button[type="submit"]:disabled,
#editCategoryForm button[type="button"]:disabled,
#editPlaceForm button[type="button"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Small circular plus buttons */
#addCategoriaBtn, #addLugarBtn, #editAddCategoryBtn, #editAddPlaceBtn {
    background: #ffe0b2;
    color: #3e2723;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Confirm / cancel secondary buttons (appear in input-wraps) */
#confirmAddCategoria, #cancelAddCategoria {
    background: none;
    color: #ffe0b2;
    border: none;
    border-radius: 1rem;
    padding: 0.4rem 1rem;
    font-weight: 700;
    cursor: pointer;
}

#confirmAddCategoria { background: #ffe0b2; color: #3e2723; }

/* Make buttons easier to hit on small screens */
@media (max-width: 600px) {
    #addForm button[type="button"],
    #addForm button[type="submit"],
    #editForm button[type="button"],
    #editForm button[type="submit"],
    #editCategoryForm button[type="button"],
    #editPlaceForm button[type="button"] {
        padding: 0.9rem 1.4rem;
        font-size: 1.1rem;
        border-radius: 1.1rem;
    }
    #addCategoriaBtn, #addLugarBtn, #editAddCategoryBtn, #editAddPlaceBtn { width: 2.6rem; height: 2.6rem; font-size: 1.5rem; }
    #closeModal, #closeEditModal, #closeEditCategoryModal, #closeEditPlaceModal, #closeRemindersModal { font-size: 1.6rem; }
}

/* Buscador */
#buscador {
    background: #23201e;
    padding: 1.2rem 1rem 0.7rem 1rem;
    text-align: center;
}
#searchInput {
    width: 100%;
    max-width: 420px;
    padding: 0.9rem 1.2rem;
    border-radius: 1.5rem;
    border: none;
    font-size: 1.1rem;
    background: #fff;
    color: #23201e;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(60,40,20,0.07);
    outline: none;
    transition: box-shadow 0.2s;
}
#searchInput:focus {
    box-shadow: 0 4px 16px rgba(60,40,20,0.13);
}

/* Filtros */
#filtros {
    background: #181716;
    padding: 0.7rem 1rem 1.2rem 1rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.categoria-btn-wrapper {
    position: relative;
    display: inline-block;
}
.category-reminder-bell {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
    z-index: 10;
    background: #ee7f7f;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    animation: bellPulse 2s infinite;
}
@keyframes bellPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}
.categoria-btn {
    background: #3e2723;
    color: #ffe0b2;
    border: none;
    border-radius: 1.5rem;
    padding: 0.6rem 1.4rem;
    margin: 0.1rem 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    text-transform: capitalize;
    letter-spacing: 0.3px;
}
.categoria-btn:hover {
    background: #4e3530;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.categoria-btn.selected {
    background: #ffe0b2;
    color: #3e2723;
    box-shadow: 0 2px 8px rgba(255,224,178,0.3);
    transform: translateY(-1px);
}
.categoria-btn.selected:hover {
    background: #ffd699;
}

/* Items / Cards */
#items {
    background: #23201e;
    box-sizing: border-box;
    padding: 2rem;
}
.item-card {
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(120deg, #2d221b 60%, #181716 100%);
    border-radius: 2.2rem;
    box-shadow: 0 4px 32px rgba(60,40,20,0.18);
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
    border: 1.5px solid #3e2723;
    transition: box-shadow 0.18s, transform 0.18s;
    padding: 0;
}
.item-card:hover {
    box-shadow: 0 8px 48px rgba(60,40,20,0.28);
    transform: scale(1.01);
}
.item-img {
    width: 38vw;
    min-width: 120px;
    max-width: 180px;
    height: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #bdbdbd;
    border-top-left-radius: 2.2rem;
    border-bottom-left-radius: 2.2rem;
    border-right: 2px solid #ffe0b2;
    box-shadow: 2px 0 12px rgba(60,40,20,0.08);
}
.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 1.3rem 1.2rem 1.8rem 1.2rem;
    min-width: 0;
    background: #f7f5f2;
    color: #2d221b;
    border-bottom-right-radius: 2.2rem;
    border-top-right-radius: 2.2rem;
    position: relative;
}

.item-action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.edit-item-btn,
.reminder-item-btn {
    flex: 1;
    background: #6d4c41;
    color: #ffe0b2;
    border: none;
    border-radius: 0.5rem;
    padding: 0.2rem;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(60,40,20,0.15);
    transition: all 0.2s ease;
    font-weight: 600;
}

.reminder-item-btn {
    background: #ee7f7f;
    color: #fff;
}

.edit-item-btn:hover {
    background: #5d4037;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60,40,20,0.25);
}

.reminder-item-btn:hover {
    background: #eaba74;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60,40,20,0.25);
}

.edit-item-btn:active,
.reminder-item-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(60,40,20,0.15);
}

.item-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0;
    color: #3e2723;
    letter-spacing: 0.5px;
    text-shadow: none;
}

/* Auth page logo (pin madera + "drawer") */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 1rem 0 0.6rem 0;
}
.auth-logo .pin-icon {
    width: 44px;
    height: 44px;
    display: block;
}
.auth-logo .logo-text, .auth-logo .brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffe0b2;
    letter-spacing: 0.6px;
    text-transform: none;
}

/* Slight spacing tweak so the cards/forms stay visually centered with the logo */
.login-page .card, .register-page .card {
    margin: 0.5rem auto;
    max-width: 400px;
}

/* Header-style title for auth pages */
div.auth-header {
    margin-left: -66px;
    width: 300px;
    text-align: center;
    margin-top: 1.6rem;
    background: transparent;
    box-shadow: none;
    position: relative;
}
div.auth-header h1 {
    display:inline-block;
    color: #ffe0b2;
}
.auth-header .auth-title {
    display: inline-flex;
    align-items: center;
    font-size: 3.6rem;
    margin: 0 0 0.6rem 0;
    background: transparent;
}

/* PWA Install Button */
.install-pwa-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, #ffe0b2 0%, #ffd699 100%);
    color: #3e2723;
    border: 2px solid rgba(62, 39, 35, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(60, 40, 20, 0.15);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.install-pwa-btn:hover {
    background: linear-gradient(135deg, #ffd699 0%, #ffcc80 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 40, 20, 0.25);
    border-color: rgba(62, 39, 35, 0.2);
}

.install-pwa-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(60, 40, 20, 0.15);
}

.install-pwa-btn .app-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.install-pwa-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .install-pwa-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }
    
    .install-pwa-btn .app-icon {
        width: 20px;
        height: 20px;
    }
    
    .install-pwa-btn svg {
        width: 16px;
        height: 16px;
    }
    
    div.auth-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-left: 0;
        width: 100%;
    }
}

.pin-icon { width: 120px; height: 120px;  }
.auth-header .auth-title .logo-text {
    display: inline-block;
    max-width: 280px; /* ajusta según sea necesario */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
#appTitle, .logo-text {
    font-family: 'Courier New', 'Courier', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
}
.logo-text{
    color: #cf925d;
    margin-left: -.4em;
    letter-spacing: 0.05em;
}
.item-location {
    font-size: 1rem;
    color: #795548;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4em;
    min-width: 0;
}

.item-location > span:last-child {
    flex: 1;
    min-width: 0;
}

.item-meta {
    font-size: 1.01rem;
    color: #4e342e;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
    min-width: 0;
}

.item-meta > span:last-child {
    flex: 1;
    min-width: 0;
}

.item-reminder {
    position: absolute;
    bottom: 0.6rem;
    right: 1rem;
    font-size: 0.95rem;
    color: #c62828;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #c62828;
    cursor: pointer;
}

.item-reminder:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    #items {
        gap: 1.1rem;
    }
    .item-card {
        flex-direction: column;
        border-radius: 1.5rem;
        max-width: 98vw;
    }
    .item-img {
        width: 100%;
        min-width: 0;
        max-width: 100vw;
        /* make vertical images bigger and let the item stretch */
        height: min(70vh, 80vw);
        min-height: 220px;
        max-height: 80vh;
        border-radius: 1.5rem 1.5rem 0 0;
        border-right: none;
        border-bottom: 2px solid #ffe0b2;
        object-fit: cover; /* cover keeps full area filled while focusing the image */
    }
    .item-info {
        padding: 1.1rem 1.1rem 1.1rem 1.1rem;
        border-bottom-right-radius: 1.5rem;
        border-top-right-radius: 0;
        border-bottom-left-radius: 1.5rem;
    }
}
@media (min-width: 700px) {
    #items {
        gap: 2rem;
        justify-items: center;
    }
    .item-card {
        max-width: 420px;
    }
    #itemCards {
        grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr)) !important;
    }
}

/* Grid for cards */
#itemCards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0;
}

/* Footer styles moved from inline attributes in index.html */
footer {
    background: #000;
    color: #bdbdbd;
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: 0.95rem;
    /* keep footer visible at bottom when page content is short */
    margin-top: auto;
    flex-shrink: 0;
}
#footerText {
    margin-bottom: 0.35rem;
}
#footerContact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Ensure the main content area expands to fill available space */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    background: #22201e;
}
#footerEmail {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
#footerContactLabel {
    margin-right: 0.35rem;
}

/* Login page styles (moved from login.html) */
.login-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #fafafa;
    font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial;
}
.login-page .card {
    background: #23201e;
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 360px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.login-page .card h2 { margin: 0 0 1rem 0; color: #ffe0b2; }
.login-page .field { margin-bottom: 0.8rem; }
.login-page .field input { width: 100%; padding: 0.6rem; border-radius: 8px; border: none; }
.login-page .btn { width: 100%; padding: 0.7rem; border-radius: 8px; background: #ffe0b2; color: #3e2723; border: none; font-weight: 700; cursor: pointer; }
.login-page .muted { color: #bdbdbd; font-size: 0.9rem; margin-top: 0.6rem; text-align: center; }
.login-page .link { color:#ffe0b2; text-decoration:underline; cursor:pointer; }
.login-page .form-footer-text {
    margin-top: .5rem;
    margin-bottom: 0;
    text-align: center;
    color: #9e9e9e;
    font-size: 0.95rem;
    font-style: italic;
    opacity: 0.85;
}   
.login-page .form-footer-text:first-of-type {
    margin-top: 1.5rem !important;
}
.login-page #error { color: #ffccbc; margin-top: 0.6rem; display: none; }

/* Register page styles (moved from register.html) */
.register-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #fafafa;
    font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial;
}
.register-page .card {
    background: #23201e;
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 360px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.register-page .card h2 { margin: 0 0 1rem 0; color: #ffe0b2; }
.register-page .field { margin-bottom: 0.8rem; }
.register-page .field input { width: 100%; padding: 0.6rem; border-radius: 8px; border: none; }
.register-page .btn { width: 100%; padding: 0.7rem; border-radius: 8px; background: #ffe0b2; color: #3e2723; border: none; font-weight: 700; cursor: pointer; }
.register-page .muted { color: #bdbdbd; font-size: 0.9rem; margin-top: 0.6rem; text-align: center; }
.register-page .checkbox-row { display:flex; align-items:center; gap:0.6rem; margin-top:0.4rem; }
.register-page .checkbox-row input[type=checkbox]{ width:1rem; height:1rem; }
.register-page .link { color:#ffe0b2; text-decoration:underline; cursor:pointer; }
.register-page .form-footer-text {
    margin-top: 1.5rem;
    margin-bottom: 0;
    text-align: center;
    color: #9e9e9e;
    font-size: 0.95rem;
    font-style: italic;
    opacity: 0.85;
}

/* Ensure register-page and login-page links keep the desired color on mobile / iOS
   - target anchor elements and all link states
   - use -webkit-text-fill-color and !important to override UA styles
   - remove tap highlight color for nicer touch behavior */
.register-page a,
.register-page a:link,
.register-page a:visited,
.register-page a:hover,
.register-page a:active,
.register-page .link,
.login-page a,
.login-page a:link,
.login-page a:visited,
.login-page a:hover,
.login-page a:active,
.login-page .link {
    color: #ffe0b2 !important;
    text-decoration: underline !important;
    -webkit-text-fill-color: #ffe0b2 !important;
    -webkit-tap-highlight-color: transparent;
}

.register-page #error { color:#ffccbc; margin-top:0.6rem; display:none; }

/* Error Toast / Modal */
#errorToast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, #3e2723 0%, #2d221b 100%);
    color: #fff;
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: 0 8px 48px rgba(255, 77, 77, 0.4), 0 0 0 2px #ff8a65;
    z-index: 2000;
    display: none;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 2px solid #ff8a65;
}

#errorToast.show {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#errorToast .toast-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

#errorToast .toast-icon {
    font-size: 2rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#errorToast .toast-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffccbc;
    margin: 0;
}

#errorToast .toast-message {
    color: #f5f5f5;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

#errorToast .toast-close {
    background: #ffe0b2;
    color: #3e2723;
    border: none;
    border-radius: 0.8rem;
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
    align-self: flex-end;
}

#errorToast .toast-close:hover {
    background: #ffd699;
    transform: translateY(-1px);
}

#errorToast .toast-close:active {
    transform: translateY(0);
}

/* Error toast overlay */
#errorToastOverlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 23, 22, 0.85);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(2px);
}

#errorToastOverlay.show {
    display: block;
}

/* Tooltip for truncated text */
.item-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #3e2723 0%, #2d221b 100%);
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 280px;
    word-wrap: break-word;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1.5px solid #ffe0b2;
}

.item-tooltip.show {
    opacity: 1;
}

.item-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #3e2723;
}

/* Truncate text utility classes */
.truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.truncate-50 {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Social Share Buttons */
#socialShare {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    padding: 0;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.twitter {
    background: #000; /* X brand color */
    border: 1px solid #333;
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.native {
    background: #ffe0b2;
    color: #3e2723;
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

/* Reminders Modal Styles */
.modal-content-reminders {
    max-height: 80vh;
    overflow-y: auto;
}

#remindersList {
    max-height: 300px;
    overflow-y: auto;
}

.reminder-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#reminderDatetime {
    width: 100%;
}

#addReminderBtn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Reminders button styles in modal */
.edit-reminder-btn:hover,
.delete-reminder-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.edit-reminder-btn:active,
.delete-reminder-btn:active {
    transform: scale(0.95);
}
