/* --- GLOBAL THEME VARIABLES --- */
:root {
    /* Light Theme */
    --bg-body: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-hero-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-header: #0f172a;
    --text-muted: #64748b;
    --text-hero: #f8fafc;
    --border-card: #e2e8f0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --icon-bg: #eff6ff;
    --icon-color: #3b82f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-body: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.85);
    --bg-hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    --bg-card: #1e293b;
    --text-main: #e2e8f0;
    --text-header: #f8fafc;
    --text-muted: #94a3b8;
    --text-hero: #cbd5e1;
    --border-card: #334155;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --icon-bg: rgba(96, 165, 250, 0.1);
    --icon-color: #60a5fa;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.8; 
    transition: background-color 0.3s ease, color 0.3s ease; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER & NAV --- */
header { 
    background-color: var(--bg-header); 
    padding: 15px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-card);
}

.logo { 
    font-family: 'Poppins', sans-serif; 
    font-size: 1.6em; 
    font-weight: 700; 
    color: var(--accent); 
    letter-spacing: -0.5px; 
    text-decoration: none; 
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 6px; 
}

nav { display: flex; align-items: center; gap: 20px; }

nav > a, .dropbtn { 
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 500; 
    font-size: 0.95em;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

nav > a:hover, .dropbtn:hover { color: var(--accent); }

/* --- DROPDOWN MENUS --- */
.dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

.dropbtn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; 
    right: 0;
    background-color: var(--bg-card);
    min-width: 220px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    z-index: 2000;
    padding: 8px 0;
    margin-top: 15px;
    backdrop-filter: blur(12px);
    animation: fadeIn 0.2s ease-in-out;
}

/* Invisible Bridge */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.9em;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--icon-bg);
    color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- THEME TOGGLE --- */
.theme-toggle { 
    background: transparent; 
    border: 1px solid var(--border-card); 
    border-radius: 50%; 
    cursor: pointer; 
    width: 40px; 
    height: 40px; 
    font-size: 1.1em; 
    color: var(--text-main); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.3s ease;
}

.theme-toggle:hover { background-color: var(--border-card); color: var(--accent); }

/* --- HERO SECTION --- */
.hero { 
    text-align: center; 
    padding: 80px 20px; 
    background: var(--bg-hero-gradient); 
    color: var(--text-hero); 
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 25%);
    pointer-events: none;
}

.hero h1 { 
    font-family: 'Poppins', sans-serif; 
    font-size: clamp(2em, 5vw, 3.5em); 
    font-weight: 700;
    margin-bottom: 15px; 
    line-height: 1.2;
}

.hero p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1em;
    opacity: 0.9;
}

/* --- DAILY TIP WIDGET --- */
.daily-tip-wrapper {
    max-width: 800px;
    margin: 50px auto 0; /* Centered horizontally with top margin */
    padding: 0 20px;
    animation: fadeIn 1s ease-in-out;
}

.tip-card {
    background-color: var(--bg-card);
    /* The Frame */
    border: 3px solid var(--accent); 
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-hover); /* Stronger shadow to make it pop */
    
    /* Centralizing everything */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.tip-header {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the icon and text */
    gap: 10px;
    font-size: 1.3em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Optional: background pill behind header */
    background: var(--icon-bg);
    padding: 8px 20px;
    border-radius: 50px;
    width: fit-content;
}

.tip-content {
    color: var(--text-main);
    font-size: 1.15em; /* Slightly larger text */
    font-weight: 500;
    font-style: italic;
    line-height: 1.6;
    max-width: 90%;
}

.tip-loading {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* --- MAIN CONTENT & GRID --- */
.main-content { padding: 60px 5%; max-width: 1200px; margin: 0 auto; flex: 1; }

.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

/* --- CARDS --- */
.card { 
    background-color: var(--bg-card); 
    border-radius: 16px; 
    border: 1px solid var(--border-card); 
    padding: 30px; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow); 
    position: relative; 
    text-decoration: none; 
    height: 100%;
}

.card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--shadow-hover); 
    border-color: var(--accent); 
}

.icon-box {
    width: 50px;
    height: 50px;
    background-color: var(--icon-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card:hover .icon-box { transform: scale(1.1) rotate(3deg); }
.card-icon { width: 28px; height: 28px; color: var(--icon-color); }

.card h2 { 
    font-family: 'Poppins', sans-serif; 
    font-size: 1.35em; 
    margin-bottom: 10px; 
    color: var(--text-main); 
    font-weight: 600; 
}

.card p { 
    margin-bottom: 25px; 
    color: var(--text-muted); 
    flex-grow: 1; 
    font-size: 0.95em; 
}

.read-more { 
    color: var(--accent); 
    font-weight: 600; 
    font-family: 'Poppins', sans-serif; 
    font-size: 0.9em;
    display: flex; 
    align-items: center; 
    gap: 5px;
    margin-top: auto;
}

.read-more span { transition: transform 0.2s ease; }
.card:hover .read-more span { transform: translateX(5px); }

/* --- SUBPAGE SPECIFIC --- */
.breadcrumb { 
    padding: 30px 5% 10px; max-width: 900px; margin: 0 auto; width: 100%; font-size: 0.9em; color: var(--text-muted); 
}
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

.article-container { max-width: 900px; margin: 0 auto; padding: 20px 5% 80px; width: 100%; flex: 1; }

.article-container h1 { font-family: 'Poppins', sans-serif; font-size: clamp(2em, 4vw, 2.8em); margin-bottom: 20px; color: var(--text-header); line-height: 1.2; }
.article-container h2 { font-family: 'Poppins', sans-serif; font-size: 1.8em; margin: 50px 0 20px; color: var(--text-header); }
.article-container p { margin-bottom: 24px; font-size: 1.1em; color: var(--text-muted); }
.article-container ul { margin-bottom: 30px; padding-left: 20px; color: var(--text-muted); font-size: 1.05em; }
.article-container li { margin-bottom: 12px; }
.article-container li strong { color: var(--text-main); }

/* --- EXTERNAL RESOURCES --- */
.external-resource { 
    margin-top: 60px; 
    padding: 40px; 
    background-color: var(--bg-card); 
    border: 1px solid var(--border-card); 
    border-radius: 16px; 
    box-shadow: var(--shadow); 
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.external-resource::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent);
}

.external-resource:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.external-resource h3 { margin-top: 0; color: var(--text-main); font-family: 'Poppins', sans-serif; font-size: 1.4em; }

.external-btn { 
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 10px; padding: 12px 28px; 
    background-color: var(--accent); color: #fff; 
    text-decoration: none; border-radius: 50px; 
    font-weight: 600; font-size: 0.95em;
    transition: background 0.2s, transform 0.2s; 
}
.external-btn:hover { background-color: var(--accent-hover); transform: translateX(5px); }

/* --- FOOTER --- */
footer { 
    background-color: var(--bg-card); 
    color: var(--text-muted); 
    text-align: center; 
    padding: 40px 20px; 
    border-top: 1px solid var(--border-card); 
    margin-top: auto;
    font-size: 0.9em;
}

.footer-tools { display: flex; justify-content: center; gap: 30px; margin-bottom: 30px; flex-wrap: wrap; }
.footer-tools a { color: var(--text-muted); text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.footer-tools a:hover { color: var(--accent); text-decoration: underline; }

/* --- ACCORDION / DETAILS STYLING --- */
details {
    background-color: var(--bg-body);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 25px;
    transition: background-color 0.3s ease;
}

details:hover {
    border-color: var(--accent);
}

details[open] {
    background-color: var(--icon-bg);
    border-color: var(--accent);
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

summary:hover {
    color: var(--accent);
}

summary::after {
    content: '+';
    font-size: 1.5em;
    color: var(--accent);
    line-height: 1;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

summary::-webkit-details-marker {
    display: none;
}

.details-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.95em;
    color: var(--text-muted);
    line-height: 1.7;
    animation: fadeIn 0.3s ease-in-out;
}

[data-theme="dark"] .details-content {
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) { 
    header { 
        flex-direction: column; 
        gap: 20px; 
        padding: 20px 5%;
    } 
    
    nav { 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 10px; 
        width: 100%;
    }
    
    nav > a, .dropbtn {
        background: var(--bg-body);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 0.85em;
        border: 1px solid var(--border-card);
    }

    .dropdown-content {
        position: absolute;
        width: 220px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        text-align: center;
    }
    
    .dropdown:hover .dropdown-content { animation: none; }

    .theme-toggle { margin-left: 0; }
    .hero { padding: 60px 20px; }
    .grid-container { grid-template-columns: 1fr; } 
    .external-resource { padding: 30px 20px; }
    .footer-tools { gap: 15px; flex-direction: column; }
}