/* === (NEW) Import Google Font for Logo === */
/* This is now in header.php for faster loading, but here for reference */
/* @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap'); */

/* === CSS Variables (Your Site's Theme) === */
:root {
    --color-bg: #1a1a1a;        /* Dark background */
    --color-surface: #2c2c2c;   /* Slightly lighter surface (for cards/headers) */
    --color-text: #f0f0f0;      /* Light text */
    --color-primary: #00bfa5;   /* A bright teal/green accent */
    --color-border: #444;
}

/* === Basic Reset & Body Styling === */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* === Particle Canvas Background === */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    background-color: var(--color-bg); /* Fallback */
}

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

h1, h2 {
    color: var(--color-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* =====================================
   HEADER & NAVIGATION
===================================== */
.main-header {
    background-color: rgba(44, 44, 44, 0.85); /* frosted glass over particles */
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text);
    flex-shrink: 0;
}
.logo:hover {
    text-decoration: none;
}

/* Fancy animated logo text */
.fancy-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background-image: linear-gradient(
        90deg,
        #f0f0f0,
        var(--color-primary),
        #f0f0f0
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 250% auto;
    animation: gradient-flow 6s ease-in-out infinite;
    transition: all 0.3s ease;
}

.fancy-logo:hover {
    text-decoration: none;
    text-shadow: 0 0 12px rgba(0, 191, 165, 0.6);
    animation-play-state: paused;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Desktop nav layout */
.main-nav {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
    gap: 1.5rem;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.main-nav li {
    margin-left: 20px;
    white-space: nowrap;
}

.main-nav a {
    font-weight: 500;
    color: #e5e7eb;
}
.main-nav a:hover {
    color: var(--color-primary);
}
.main-nav a.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* Admin pill-style link */
.main-nav a.admin-link {
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 5px 10px;
    border-radius: 5px;
    border-bottom: none;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.main-nav a.admin-link:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    box-shadow: 0 0 10px rgba(0, 191, 165, 0.7);
}

/* Search form (desktop) */
.search-form {
    display: flex;
    flex-shrink: 0;
}

.search-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-border);
    border-right: none;
    padding: 6px 10px;
    color: var(--color-text);
    border-radius: 5px 0 0 5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 150px;
}
.search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--color-primary);
    width: 200px;
}
.search-button {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: var(--color-bg);
    font-weight: bold;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-button:hover {
    opacity: 0.8;
}

/* Hamburger toggle button (visible on mobile) */
.nav-toggle {
    display: none; /* Shown in mobile via media query */
    background: transparent;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    z-index: 1010; /* above dropdown menu */
}

.nav-toggle svg {
    width: 28px;
    height: 28px;
    stroke: var(--color-text);
    stroke-width: 2;
    fill: none;
    transition: stroke 0.3s ease;
}

.nav-toggle:hover svg {
    stroke: var(--color-primary);
}

/* Hide the "X" by default, show when nav is open */
.nav-toggle .close-icon {
    display: none;
}

/* When body has .nav-open, swap icons */
.nav-open .nav-toggle .hamburger-icon {
    display: none;
}
.nav-open .nav-toggle .close-icon {
    display: inline-block;
}

/* =====================================
   MAIN CONTENT & FOOTER
===================================== */
main.container {
    padding-top: 2rem;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.main-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: #aaa;
    position: relative;
    z-index: 1;
}

/* === Reusable Components === */
.cta-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid var(--color-primary);
    cursor: pointer;
}
.cta-button:hover {
    opacity: 0.8;
    text-decoration: none;
}
.cta-button.secondary {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.cta-button.secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

/* === Featured sections === */
.featured-project,
.featured-blog {
    background-color: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Featured images on homepage */
.featured-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

/* === Blog List Styles (on homestead.html) === */
.section-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.blog-post-list {
    list-style: none;
    padding: 0;
}

.blog-post-list li {
    margin-bottom: 1rem;
}

.blog-post-list .post-date {
    display: inline-block;
    width: 120px;
    color: #aaa;
    font-size: 1rem;
}

/* === Single Blog Post Styles (in /blog/ folder) === */
.blog-post {
    background-color: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
}

.blog-post .post-meta {
    color: #aaa;
    font-style: italic;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.blog-post .post-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.blog-post h2 {
    margin-top: 2.5rem;
}

.blog-post blockquote {
    border-left: 4px solid var(--color-primary);
    margin-left: 0;
    padding-left: 1.5rem;
    font-style: italic;
    font-size: 1.1rem;
    color: #ccc;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    font-weight: bold;
    background-color: var(--color-surface);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--color-border);
}
.back-link:hover {
    background-color: var(--color-primary);
    color: var(--color-bg);
    text-decoration: none;
}

/* === Admin Table Styles === */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}
.admin-table th,
.admin-table td {
    padding: 12px;
    border: 1px solid var(--color-border);
    text-align: left;
}
.admin-table th {
    background-color: var(--color-surface);
}
.admin-table td.actions a {
    margin-right: 10px;
}
.admin-table td.actions a.edit {
    color: #75d0c3;
}
.admin-table td.actions a.delete {
    color: #ff8a8a;
}

/* === Project Grid Styles === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: start;
}

.project-card {
    background-color: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 1rem;
    background-color: #333;
}

.project-card h3 {
    color: var(--color-primary);
    margin-top: 0;
}

.project-card .tags {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.project-card p {
    flex-grow: 1;
}

.project-card .project-links {
    padding-top: 1rem;
}

.project-card .project-links .cta-button {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* === Blog List Item Styles === */
.blog-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    background-color: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.blog-thumbnail {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1.5rem;
    background-color: #333;
    flex-shrink: 0;
}

.blog-list-content {
    flex-grow: 1;
}

.blog-list-content .post-date {
    display: block;
    width: auto;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.blog-list-content .post-title {
    font-size: 1.25rem;
    display: inline-block;
}

.blog-list-content .post-excerpt {
    font-size: 1rem;
    color: #ccc;
    margin: 0.5rem 0 0 0;
}

/* =====================================
   ADMIN FORM STYLES
===================================== */
.admin-nav {
    background-color: var(--color-surface);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.admin-nav .welcome-msg {
    color: #ccc;
    margin-right: auto;
}
.admin-nav a {
    color: var(--color-text);
    padding: 5px 10px;
    font-weight: bold;
}
.admin-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}
.admin-nav a.logout {
    color: #ff8a8a;
}
.admin-nav a.logout:hover {
    color: #ff5252;
}

.admin-title {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.admin-error {
    color: #ff8a8a;
    background-color: #4d2f2f;
    border: 1px solid #ff5252;
    padding: 1rem;
    border-radius: 5px;
}
.admin-success {
    color: #9eff9e;
    background-color: #385038;
    border: 1px solid #69f069;
    padding: 1rem;
    border-radius: 5px;
}

.admin-form {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #f0f0f0;
}
.form-group .form-control {
    width: 100%;
    padding: 12px;
    color: #333;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}
.form-group textarea.form-control {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}
.form-group .form-control-file {
    color: #f0f0f0;
    font-size: 1rem;
    padding: 10px 0;
}
.form-group .form-text {
    font-size: 0.9rem;
    color: #aaa;
    display: block;
    margin-top: 0.25rem;
}

.form-group .current-image-preview {
    background-color: #444;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
}
.form-group .current-image-preview img {
    height: 60px;
    width: auto;
    border-radius: 3px;
    margin-right: 10px;
}

.form-group-checkbox {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}
.form-group-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}
.form-group-checkbox label {
    display: flex;
    align-items: center;
    font-weight: bold;
    margin-bottom: 0;
}
.form-group-checkbox .form-text {
    margin-left: 1rem;
    margin-top: 0;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.form-actions .cta-button {
    margin-right: 1rem;
}

/* =====================================
   SEARCH RESULTS STYLES
===================================== */
.search-title {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}
.search-subtitle {
    font-weight: 300;
    color: #ccc;
}
.search-subtitle strong {
    color: var(--color-primary);
    font-weight: 700;
}

.search-results-list {
    margin-top: 2rem;
}

.search-result-item {
    background-color: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.search-result-item .result-type {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.search-result-item .result-title {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.search-result-item .result-title a {
    color: var(--color-primary);
}
.search-result-item .result-excerpt {
    color: #ccc;
    margin: 0;
}
.search-result-item .result-date {
    display: block;
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Spam trap field */
.honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    visibility: hidden;
}

/* =====================================
   ADMIN STATS STYLES
===================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    color: var(--color-primary);
}

.stat-card p {
    margin: 0;
    color: #ccc;
    font-weight: bold;
}

/* Special style for "Pending" card */
.stat-card.pending {
    border-color: #ffc107;
    background-color: #493b13;
}
.stat-card.pending h3 {
    color: #ffc107;
}
.stat-card.pending p {
    color: #fff;
}
.stat-card .stat-link {
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #ffc107;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}
.stat-card .stat-link:hover {
    opacity: 0.8;
}

/* ===========================
   Google Login & Profiles
   =========================== */
.google-login {
    background: #ffffff;
    color: #444444;
    border: 1px solid #dadce0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.google-login:hover {
    background: #f8f9fa;
    color: #202124;
}

.google-login-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
}

/* Small Google avatar used in admin/user list */
.google-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ccc;
    vertical-align: middle;
    margin-right: 0.35rem;
}

/* Chip style */
.google-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #e8f0fe;
    color: #174ea6;
    border: 1px solid #d2e3fc;
}

/* Avatar styling (primary nav/user avatar) */
.google-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1fbf9a;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.google-avatar:hover {
    transform: scale(1.06);
    transition: 0.15s ease-in-out;
}

/* User area in nav */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 45px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    background: #ffffff;
    color: #444;
    border: 1px solid #d0d0d0;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
}

.google-login-btn:hover {
    background: #f5f5f5;
}

.google-login-btn:active {
    transform: scale(0.98);
}

.google-icon svg {
    display: block;
}

/* =====================================
   MOBILE & TABLET STYLES (NAV)
===================================== */
@media (max-width: 960px) {
    .main-header .container {
        justify-content: space-between;
    }

    /* Show hamburger on mobile */
    .nav-toggle {
        display: block;
    }

    /* Make main nav a dropdown panel */
    .main-nav {
        display: none; /* hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(44, 44, 44, 0.97);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0 1rem 0;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    /* When nav-open class is on body, show the dropdown */
    .nav-open .main-nav {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .main-nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 0.85rem 1.5rem;
        text-align: left;
        border-bottom: none;
    }

    .main-nav a.active {
        background-color: rgba(0, 191, 165, 0.14);
    }

    .main-nav a.admin-link {
        margin: 0.5rem 1.5rem;
        width: calc(100% - 3rem);
        box-sizing: border-box;
        text-align: center;
    }

    .nav-user {
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid var(--color-border);
        gap: 12px;
    }

    /* Search full-width under links */
    .search-form {
        padding: 1rem 1.5rem 0;
        width: 100%;
        box-sizing: border-box;
    }

    .search-input {
        width: 100%;
        flex-grow: 1;
    }
    .search-input:focus {
        width: 100%;
    }
}

/* =======================
   Home page layout tweaks
   ======================= */

.home-main {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

/* Intro / hero */
.home-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.home-intro h1 {
    margin-bottom: 0.5rem;
}

.home-intro p {
    max-width: 640px;
    margin: 0 auto 1.5rem auto;
    color: #d1d5db;
}

.home-intro-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Stack the main sections (Homestead then Projects) */
.home-sections {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Make headings inside cards consistent */
.home-homestead h2,
.home-projects h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.home-homestead h3,
.home-projects h3 {
    color: var(--color-primary);
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.home-small-link {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

.home-small-link a {
    color: var(--color-primary);
}

/* Recent posts list under the featured homestead post */
.home-recent-posts {
    list-style: none;
    margin: 1.5rem 0 0 0;
    padding: 1rem 0 0 0;
    border-top: 1px solid var(--color-border);
}

.home-recent-posts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.home-recent-posts li:last-child {
    border-bottom: none;
}

.recent-post-title {
    color: #e5e7eb;
    font-weight: 500;
}

.recent-post-title:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.recent-post-date {
    font-size: 0.85rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* On very small screens, stack title and date */
@media (max-width: 520px) {
    .home-recent-posts li {
        flex-direction: column;
        align-items: flex-start;
    }
}