@import "recurring_tasks.css";
@import "habits.css";
@import "tasks.css";
@import "home.css";
@import "layout.css";

:root {
    /* Pastel Palette */
    --bg-color: #fdfbf7;
    /* Warm off-white */
    --text-color: #4a4a4a;
    /* Soft charcoal */
    --primary-color: #a8d5ba;
    /* Pastel Mint */
    --secondary-color: #f5b7b1;
    /* Pastel Rose */
    --accent-color: #a9cce3;
    /* Pastel Blue */
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --heading-color: #2c3e50;
    --alert-bg: #fadbd8;
    --alert-text: #c0392b;
    --notice-bg: #d4efdf;
    --notice-text: #27ae60;
    --muted-text-color: #666666;
    --navbar-bg: rgba(240, 240, 240, 0.9);
    --mobile-menu-bg: rgba(240, 240, 240, 0.98);
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --primary-color: #4a7a5a;
    /* Darker mint */
    --secondary-color: #a65c5c;
    /* Darker rose */
    --accent-color: #5c7c9c;
    /* Darker blue */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --heading-color: #e0e0e0;
    --alert-bg: #5c2b2b;
    --alert-text: #ffcccc;
    --notice-bg: #2b5c3a;
    --notice-text: #ccffdd;
    --muted-text-color: #aaaaaa;
    --notice-text: #ccffdd;
    --muted-text-color: #aaaaaa;
    --notice-text: #ccffdd;
    --muted-text-color: #aaaaaa;
    --navbar-bg: rgba(30, 30, 30, 0.85);
    /* Neutral Dark Gray */
    --mobile-menu-bg: rgba(30, 30, 30, 0.95);
    --mobile-menu-bg: rgba(30, 30, 30, 0.95);
    --border-color: #333;
    --input-bg: #333333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-bottom: 0.5em;
    color: var(--heading-color);
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    padding: 1.5rem 2rem;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    position: relative;
    /* Ensure relative positioning for absolute children */
}

.theme-toggle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

.nav-links a {
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Navbar Dropdowns */
.nav-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 1.5rem;
}

.nav-dropdown-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-dropdown-summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-summary:hover {
    color: var(--text-color);
    /* Maintain standard color on hover, optional */
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    /* Reset text align if mobile centers things */
    text-align: left;
}

/* Override nav-links a margin in dropdown */
.nav-dropdown-menu a {
    display: block;
    margin: 0 !important;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
}

.nav-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 1rem;
    display: inline-block;
    vertical-align: middle;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-action:hover {
    background-color: var(--hover-color);
}

/* Shared Form Styles */
.form-container {
    width: 100%;
}

.form-container h1 {
    margin-bottom: 2rem;
}

/* Shared Detail Styles */
.detail-container {
    width: 100%;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #2c3e50;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 213, 186, 0.4);
    color: #fff;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
}



.search-container {
    margin-bottom: 2rem;
}

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

.resource-search-input {
    width: 100%;
    padding: 0.8rem 3rem;
    /* Padding for left icon and right clear button */
    border: 2px solid #eee;
    border-radius: 20px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.resource-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.resource-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: var(--muted-text-color);
}

.resource-search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
    width: 20px;
    height: 20px;
    color: var(--muted-text-color);
}

.resource-search-clear:hover {
    opacity: 1;
}

[data-theme="dark"] .resource-search-input {
    border-color: #444;
}


/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.page-header .actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.header-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-text-color);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--muted-text-color);
    font-size: 1rem;
    line-height: 1;
    margin-top: 0.5rem;
    /* Align visually with text/image top */
}

.btn-back:hover {
    color: var(--text-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 0;
    height: 100%;
    box-sizing: border-box;
}

.interactive-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 0;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.interactive-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--muted-text-color);
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

.auth-title {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.alert,
.notice {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.alert {
    background-color: var(--alert-bg);
    color: var(--alert-text);
}

.notice {
    background-color: var(--notice-bg);
    color: var(--notice-text);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    justify-content: center;
    align-items: center;
}

/* Reset generic span styles to avoid double boxing */
.pagination span {
    border: none;
    padding: 0;
    background: none;
}

/* Style the links and the current page */
.pagination a,
.pagination .current {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.pagination a:hover {
    background: var(--bg-color);
    border-color: var(--accent-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .gap {
    border: none;
    background: transparent;
    padding: 0.5rem;
    color: var(--text-color);
}

/* Tabs */
/* Tabs */
.resource-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.tab-link {
    text-decoration: none;
    color: var(--muted-text-color);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-link:hover {
    background-color: transparent;
    color: var(--text-color);
}

.tab-link.active {
    background-color: transparent;
    color: var(--text-color);
    font-weight: 600;
    border-bottom-color: var(--text-color);
}

/* Mobile Navigation */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        right: 0;
        background-color: var(--mobile-menu-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        border-top: 1px solid var(--border-color);
        text-align: center;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links a {
        margin: 0.75rem 0;
        display: block;
        margin-left: 0;
        /* Reset desktop margin */
        font-size: 1.1rem;
    }
}

/* Animations */
@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(168, 213, 186, 0.7);
        border-color: var(--primary-color);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(168, 213, 186, 0);
        border-color: transparent;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(168, 213, 186, 0);
        border-color: transparent;
    }
}

.highlight-pulse {
    border: 2px solid transparent;
    animation: highlight-pulse 1.5s ease-out;
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.fab-btn:hover {
    background-color: #92c4a8;
    /* slightly darker/saturated primary */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #1a2632;
}

@media (max-width: 768px) {
    .fab-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
}


/* --- Consoliated Shared Styles --- */

/* Shared Card Headers */
.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.resource-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.resource-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* Shared Pills */
.resource-pill {
    font-size: 0.8rem;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

/* Shared Form Inputs */
.resource-form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--input-bg, #fff);
    color: var(--text-color);
}

.resource-form-input:focus {
    outline: 2px solid var(--primary-color);
    border-color: transparent;
}

/* Shared Trix Editor */
.resource-form-trix {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-family: inherit;
    min-height: 150px;
    background-color: var(--input-bg, #fff);
    color: var(--text-color);
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}