/* Style Sheet for Relationship Care Database (Premium Warm Rose Theme) */

:root {
    --primary: #f43f5e;       /* Rose-500 */
    --primary-hover: #e11d48; /* Rose-600 */
    --primary-light: #fff1f2; /* Rose-50 */
    --primary-border: #ffe4e6;/* Rose-100 */
    --secondary: #db2777;     /* Pink-600 */
    --dark-bg: #181415;       /* Charcoal Slate with Rose tint */
    --dark-sidebar: #221a1c;
    --light-bg: #faf7f7;      /* Clean soft cream */
    --card-bg: #ffffff;
    --text-dark: #1f2937;     /* Gray-800 */
    --text-muted: #6b7280;    /* Gray-500 */
    --border: #f3ebeb;
    --shadow: 0 4px 20px rgba(244, 63, 94, 0.04);
    --shadow-hover: 0 8px 30px rgba(244, 63, 94, 0.08);
}

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

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-dark);
    background-color: var(--light-bg);
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--dark-sidebar);
    color: #fce7f3;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    border-right: 1px solid rgba(244, 63, 94, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding: 0 10px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.6));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.brand-text h2 {
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
}

.brand-text span {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Prompt', sans-serif;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: #cbd5e1;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    text-align: left;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(244, 63, 94, 0.08);
    color: #ffffff;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.sidebar-footer {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    font-family: 'Prompt', sans-serif;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background-color: var(--light-bg);
}

.content-header {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background-color: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title h1 {
    font-size: 26px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.header-title p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(244, 63, 94, 0.3);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid var(--primary-border);
}

.btn-secondary:hover {
    background-color: var(--primary-border);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #fff1f2;
    color: #e11d48;
    border: 1px solid #ffe4e6;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

/* Tab Panels */
.tab-panel {
    display: none;
    padding: 30px 40px;
    flex-grow: 1;
    overflow-y: auto;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.filter-tag:hover {
    border-color: var(--primary-border);
    background-color: var(--primary-light);
}

.filter-tag.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.15);
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Cards Design */
.card-styled {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-styled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-styled:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-styled:hover::before {
    opacity: 1;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 17px;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.4;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    display: inline-block;
}

.badge-food { background-color: #ffe4e6; color: #e11d48; }
.badge-comfort { background-color: #fdf2f8; color: #db2777; }
.badge-fashion { background-color: #faf5ff; color: #9333ea; }
.badge-entertainment { background-color: #ecfeff; color: #0891b2; }
.badge-other { background-color: #f0fdf4; color: #16a34a; }

.badge-allergy { background-color: #fef2f2; color: #ef4444; border: 1px solid #fee2e2; }
.badge-dislike { background-color: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.badge-pet_peeve { background-color: #fef08a; color: #854d0e; }

.severity-high { border-left: 5px solid #ef4444; }
.severity-medium { border-left: 5px solid #f97316; }
.severity-low { border-left: 5px solid #3b82f6; }

.card-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    margin-top: auto;
}

.rating-display {
    color: #fbbf24;
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-dark);
    background-color: var(--light-bg);
}

.btn-icon-danger:hover {
    color: #e11d48;
    background-color: #fff1f2;
}

/* Date Countdown Cards */
.date-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.date-details {
    flex-grow: 1;
}

.date-details h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.date-details p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.date-badge-recurring {
    font-size: 11px;
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Prompt', sans-serif;
    display: inline-block;
}

.countdown-box {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}

.countdown-number {
    font-size: 26px;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    line-height: 1.1;
}

.countdown-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Initiatives & Checklist Layout */
.initiatives-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    align-items: start;
}

.checklist-section, .generator-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 25px;
}

.card-header-styled {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.card-header-styled h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-styled h3 i {
    color: var(--primary);
}

.card-header-styled p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Checklist Items */
.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background-color: var(--light-bg);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.todo-item:hover {
    border-color: var(--primary-border);
    background-color: #fffbfb;
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    cursor: pointer;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-color: #ffffff;
}

.todo-checkbox i {
    font-size: 12px;
}

.todo-item.completed .todo-checkbox {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.todo-text {
    font-size: 14.5px;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-freq {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Prompt', sans-serif;
    background-color: #f1f5f9;
    color: #64748b;
}

/* Date Generator Card */
.generator-card {
    border: none;
    padding: 0;
}

.generator-box {
    margin-top: 10px;
}

.idea-display {
    background-color: var(--light-bg);
    border: 1px dashed var(--primary-border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.quote-icon {
    font-size: 24px;
    color: #ffe4e6;
    margin-bottom: 12px;
}

.idea-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 15px;
}

.idea-tag {
    font-size: 11px;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
}

/* Timeline/Memory Journal Design */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 31px;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--primary-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 70px;
}

.timeline-dot {
    position: absolute;
    left: 20px;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 4px solid var(--primary);
    box-shadow: 0 0 0 4px #ffe4e6;
    z-index: 1;
}

.timeline-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

.timeline-header h3 {
    font-size: 17px;
    color: var(--text-dark);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Prompt', sans-serif;
}

.timeline-body {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.7;
    white-space: pre-line;
}

/* Modals Overlay & Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(24, 20, 21, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 20px 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group.hidden {
    display: none;
}

/* Star Rating Radio Buttons */
.rating-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    font-size: 24px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.1s ease;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
    color: #fbbf24;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--light-bg);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .initiatives-layout {
        grid-template-columns: 1fr;
    }
}

/* Mobile Topic Filter Dropdown Wrapper */
.mobile-filter-dropdown-wrapper {
    display: none;
    position: relative;
    width: 100%;
    margin-top: 5px;
}

.mobile-filter-dropdown {
    width: 100%;
    padding: 10px 35px 10px 14px;
    border-radius: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--primary-border);
    color: var(--text-dark);
    font-family: 'Prompt', sans-serif;
    font-size: 13.5px;
    outline: none;
    appearance: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.mobile-filter-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.mobile-filter-dropdown-wrapper .select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 12px;
    pointer-events: none;
}

/* Mobile Top Header Bar */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background-color: var(--dark-sidebar);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(244, 63, 94, 0.2);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    font-size: 17px;
    color: #ffffff;
}

.mobile-hamburger-btn {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.mobile-hamburger-btn:active {
    background-color: var(--primary);
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(24, 20, 21, 0.6);
    backdrop-filter: blur(4px);
    z-index: 80;
    display: none;
}

.mobile-drawer-overlay.active {
    display: block;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .initiatives-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .mobile-filter-dropdown-wrapper {
        display: block;
    }

    .desktop-only-filters {
        display: none !important;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 64px);
    }

    /* Transform Sidebar into Slide-Out Drawer on Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 90;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.3);
    }

    .sidebar.drawer-open {
        transform: translateX(0);
    }

    .content-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-title h1 {
        font-size: 20px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions button {
        width: 100%;
        justify-content: center;
    }

    .tab-panel {
        padding: 16px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-styled {
        padding: 18px;
    }

    .filter-bar {
        gap: 10px;
        margin-bottom: 20px;
    }

    .category-filters {
        overflow-x: auto;
        padding-bottom: 5px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .filter-tag {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 12px;
    }

    .timeline::before {
        left: 18px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline-dot {
        left: 7px;
    }

    /* Mobile Sheet Modal */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
}
