:root {
    /* Color Palette */
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --secondary: #52b788;
    --secondary-light: #74c69d;
    --accent: #d8f3dc;

    /* Neumorphic/Glass effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Text */
    --text-main: #1e1e1e;
    --text-muted: #555555;
    --text-light: #888888;

    /* Backgrounds */
    --bg-main: #f4fcf7;
    --bg-card: #ffffff;

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Background gradient blobs for aesthetic */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #e9f5ff 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Utilities */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.glass-button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-dark);
    font-weight: 600;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    background: #fff;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: var(--accent);
    z-index: -1;
    border-radius: 2px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.logo-icon {
    font-size: 1.5rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

#searchInput {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

#searchInput:focus {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.2);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Main Layout Setup */
.main-content {
    min-height: calc(100vh - 160px);
    padding: 2rem 0 4rem;
}

/* View management */
.view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Section / Grid */
.hero-section {
    text-align: center;
    margin: 3rem 0 4rem;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.category-pill {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.results-count {
    color: var(--text-muted);
    font-weight: 500;
}

.glass-select {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    font-family: inherit;
    font-weight: 500;
    color: var(--primary-dark);
    cursor: pointer;
    outline: none;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Tip Card */
.tip-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    cursor: pointer;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.tip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-light);
    opacity: 0;
    transition: var(--transition);
}

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

.tip-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tip-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tip-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(82, 183, 136, 0.1);
    color: var(--primary-dark);
}

.tip-card-title {
    font-size: 1.25rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 12px;
    line-height: 1.3;
}

.tip-card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    flex-grow: 1;
}

.tip-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
}

.tip-card-footer svg {
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.tip-card:hover .tip-card-footer svg {
    transform: translateX(4px);
}

/* Load More */
.load-more-btn {
    display: block;
    margin: 3rem auto;
    padding: 12px 32px;
    font-size: 1rem;
}

/* Detail View */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-dark);
}

/* Markdown Content Styling */
.tip-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.tip-content h1,
.tip-content h2,
.tip-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.tip-content h1 {
    font-size: 2.5rem;
    margin-top: 0;
    color: var(--primary-dark);
}

.tip-content h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 8px;
}

.tip-content p {
    margin-bottom: 1.5rem;
}

.tip-content ul,
.tip-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--text-muted);
}

.tip-content li {
    margin-bottom: 0.5rem;
}

.tip-content strong {
    color: var(--text-main);
}

.tip-content blockquote {
    border-left: 4px solid var(--secondary);
    padding-left: 1rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.tip-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.tip-content th,
.tip-content td {
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

.tip-content th {
    background: rgba(82, 183, 136, 0.1);
    font-weight: 600;
    color: var(--primary-dark);
}

/* Detail Navigation */
.tip-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    max-width: 48%;
}

.nav-btn:hover:not(:disabled) {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-text {
    display: flex;
    flex-direction: column;
}

.text-right {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 700;
}

.nav-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    .detail-container {
        padding: 20px;
    }

    .tip-content h1 {
        font-size: 2rem;
    }

    .tip-navigation {
        flex-direction: column;
        gap: 16px;
    }

    .nav-btn {
        max-width: 100%;
        width: 100%;
    }
}