/* ===== BULMA 1.x DARK THEME OVERRIDES ===== */
/* Must come after Bulma CDN in cascade */

:root,
[data-theme="dark"] {
    /* Background */
    --bulma-scheme-h: 220;
    --bulma-scheme-s: 25%;
    --bulma-scheme-main-l: 8%;
    --bulma-scheme-main: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), var(--bulma-scheme-main-l));
    --bulma-body-background-color: hsl(220, 25%, 8%);

    /* Cyan primary */
    --bulma-primary-h: 185;
    --bulma-primary-s: 100%;
    --bulma-primary-l: 50%;
    --bulma-primary: hsl(185, 100%, 50%);
    --bulma-primary-invert: hsl(220, 25%, 8%);

    /* Purple link */
    --bulma-link-h: 270;
    --bulma-link-s: 80%;
    --bulma-link-l: 55%;
    --bulma-link: hsl(270, 80%, 55%);

    /* Text */
    --bulma-text: #d0d0d0;
    --bulma-text-strong: #ffffff;
    --bulma-title-color: #ffffff;
}

/* ===== GLOBAL ===== */
html, body {
    background-color: hsl(220, 25%, 8%);
    color: #d0d0d0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ===== PARTICLE BACKGROUND ===== */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== SITE CONTENT (above particles) ===== */
.site-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
    background-color: hsl(220, 25%, 10%) !important;
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand .navbar-item {
    font-size: 1.3rem;
    font-weight: 700;
    color: hsl(185, 100%, 50%) !important;
    text-shadow: 0 0 10px hsl(185, 100%, 50%), 0 0 20px hsl(185, 100%, 40%);
    letter-spacing: 0.05em;
}

.navbar-item {
    color: #d0d0d0 !important;
    transition: color 0.2s;
}

.navbar-item:hover {
    background-color: transparent !important;
    color: #ffffff !important;
}

.navbar-item.is-active {
    background-color: hsl(270, 80%, 55%) !important;
    color: #ffffff !important;
    border-radius: 6px;
}

.navbar-item.is-active:hover {
    background-color: hsl(270, 80%, 65%) !important;
}

.navbar-burger span {
    background-color: #d0d0d0 !important;
}

.navbar-menu {
    background-color: hsl(220, 25%, 10%) !important;
}

/* ===== HERO ===== */
.hero.is-fullheight {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE: TABLET (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* --- Hero --- */
    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1.05rem;
    }

    .hero.is-fullheight {
        min-height: calc(100vh - 3.5rem);
    }

    /* --- Section spacing --- */
    .section {
        padding: 2rem 1rem;
    }

    /* --- Section titles --- */
    .section-title {
        font-size: 1.4rem;
    }

    /* --- Navbar --- */
    .navbar-brand .navbar-item {
        font-size: 1.05rem;
    }

    .navbar-menu {
        padding: 0.5rem 0;
    }

    .navbar-menu .navbar-item {
        padding: 0.75rem 1rem;
    }

    /* --- Sidebar layouts: stack and reorder --- */
    .columns {
        display: flex;
        flex-direction: column;
    }

    .column.is-8,
    .column.is-4,
    .column.is-6 {
        width: 100%;
        flex: none;
    }

    /* Blog sidebar: show above post list on mobile */
    .blog-sidebar {
        order: -1;
        margin-bottom: 1.5rem;
    }

    /* Contact sidebar: remove sticky, normal flow */
    .contact-sidebar {
        position: static;
        margin-top: 2rem;
    }

    /* --- Cards --- */

    .card-image img {
        height: 140px;
    }

    /* --- Project detail --- */
    .project-hero-image {
        max-height: 220px;
    }

    /* --- Touch targets (min 44px) --- */
    .tag {
        min-height: 2rem;
        padding: 0.3rem 0.65rem;
        font-size: 0.8rem;
    }

    .button {
        min-height: 2.75rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .blog-sidebar input {
        min-height: 2.75rem;
    }

    /* --- Skills grid --- */
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    /* --- Experience entries --- */
    .experience-entry {
        padding-left: 0.75rem;
    }

    /* --- Blog content --- */
    .blog-content pre {
        overflow-x: auto;
        font-size: 0.85em;
    }

    /* --- Blog cards --- */
    .blog-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .blog-card-thumb {
        width: 100%;
        height: 120px;
    }

    .blog-card-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ===== RESPONSIVE: SMALL PHONE (max-width: 480px) ===== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
        letter-spacing: 0.02em;
    }

    .section {
        padding: 1.5rem 0.75rem;
    }

    .card-image img {
        height: 120px;
    }

    .project-hero-image {
        max-height: 160px;
    }

    /* Full-width buttons on small screens */
    .button.is-primary,
    .button.is-outlined {
        width: 100%;
        text-align: center;
    }

    .navbar-brand .navbar-item {
        font-size: 0.95rem;
        letter-spacing: 0;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.35rem;
    }

    .skill-pill {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    /* Tighter card content on small screens */
    .card-content {
        padding: 0.75rem;
    }

    .contact-sidebar {
        padding: 1rem;
    }
}

.hero-tagline {
    font-size: 1.25rem;
    color: hsl(185, 100%, 70%);
    margin-bottom: 2rem;
}

/* ===== SECTION HEADINGS ===== */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: hsl(185, 100%, 50%);
    border-bottom: 1px solid rgba(0, 245, 255, 0.25);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== CARDS ===== */
.card {
    background-color: hsl(220, 25%, 12%) !important;
    border: 1px solid hsl(185, 100%, 50%);
    box-shadow: 0 0 8px rgba(0, 245, 255, 0.25), 0 0 20px rgba(0, 245, 255, 0.1);
    border-radius: 8px;
    transition: box-shadow 0.3s, transform 0.2s;
}

/* Equal-height cards only in side-by-side grid layouts (Projects) */
.columns.is-multiline > .column > .card {
    height: 100%;
}

.card:hover {
    box-shadow: 0 0 16px rgba(0, 245, 255, 0.45), 0 0 40px rgba(0, 245, 255, 0.2);
    transform: translateY(-2px);
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.card-header-title {
    color: #ffffff !important;
    font-weight: 600;
}

.card-content {
    color: #d0d0d0;
}

.card-image img {
    border-radius: 8px 8px 0 0;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: hsl(220, 25%, 15%);
}

/* ===== BUTTONS ===== */
.button.is-primary {
    background-color: hsl(270, 80%, 55%) !important;
    border-color: hsl(270, 80%, 55%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(139, 34, 232, 0.4);
    font-weight: 600;
    transition: all 0.2s;
}

.button.is-primary:hover {
    background-color: hsl(270, 80%, 65%) !important;
    box-shadow: 0 0 20px rgba(139, 34, 232, 0.6);
}

.button.is-outlined {
    border-color: hsl(185, 100%, 50%) !important;
    color: hsl(185, 100%, 50%) !important;
    background-color: transparent !important;
}

.button.is-outlined:hover {
    background-color: hsl(185, 100%, 50%) !important;
    color: hsl(220, 25%, 8%) !important;
}

/* ===== TAG PILLS ===== */
.tag {
    background-color: transparent !important;
    border: 1px solid hsl(185, 100%, 50%);
    color: hsl(185, 100%, 50%) !important;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== CONTACT SIDEBAR ===== */
.contact-sidebar {
    background-color: hsl(220, 25%, 12%);
    border: 1px solid hsl(185, 100%, 50%);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 5rem;
}

.contact-sidebar a {
    color: hsl(185, 100%, 50%);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.contact-sidebar a:hover {
    color: #ffffff;
}

/* ===== EXPERIENCE ENTRIES ===== */
.experience-entry {
    border-left: 3px solid hsl(185, 100%, 50%);
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.experience-entry .job-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.experience-entry .company {
    color: hsl(185, 100%, 60%);
    font-weight: 600;
}

.experience-entry .period {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.experience-entry ul {
    list-style: none;
    padding: 0;
}

.experience-entry ul li::before {
    content: '▸ ';
    color: hsl(185, 100%, 50%);
}

/* ===== SKILLS GRID ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.skill-pill {
    background-color: hsl(220, 25%, 15%);
    border: 1px solid rgba(0, 245, 255, 0.3);
    color: #d0d0d0;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

/* ===== PROJECT DETAIL ===== */
.project-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0, 245, 255, 0.25);
    margin-bottom: 2rem;
    background: hsl(220, 25%, 15%);
}

.tech-tag {
    display: inline-block;
    background-color: hsl(220, 25%, 18%);
    border: 1px solid hsl(270, 80%, 55%);
    color: hsl(270, 80%, 75%);
    padding: 0.2rem 0.7rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.2rem;
}

.project-section {
    margin-bottom: 2.5rem;
}

.project-section h3 {
    color: hsl(185, 100%, 50%);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ===== BLOG POST CARDS ===== */
.blog-card {
    display: flex;
    gap: 1.25rem;
    background-color: hsl(220, 25%, 12%);
    border: 1px solid rgba(0, 245, 255, 0.25);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
    border-color: hsl(185, 100%, 50%);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.3);
    transform: translateY(-1px);
}

.blog-card-thumb {
    flex-shrink: 0;
    width: 160px;
    height: 110px;
    overflow: hidden;
    border-radius: 6px;
    background: hsl(220, 25%, 15%);
}

.blog-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.blog-card-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.35rem;
}

.blog-card-desc {
    font-size: 0.9rem;
    color: #b0b0b0;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
}

.blog-card-footer .tags {
    margin-bottom: 0;
}

.blog-card-footer .tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    margin-right: 0.25rem;
}

.blog-card-read {
    color: hsl(185, 100%, 50%);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}


/* ===== BLOG POST CONTENT ===== */
.blog-content h1, .blog-content h2, .blog-content h3 {
    color: hsl(185, 100%, 60%);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-content h2 {
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
    padding-bottom: 0.3rem;
}

.blog-content code {
    background-color: hsl(220, 25%, 15%);
    color: hsl(185, 100%, 60%);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.blog-content pre {
    border-radius: 8px;
    border: 1px solid rgba(0, 245, 255, 0.15);
    margin: 1rem 0;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.blog-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.blog-content ul, .blog-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.blog-content a {
    color: hsl(185, 100%, 55%);
}

/* ===== BLOG SIDEBAR ===== */
.blog-sidebar .box {
    background-color: hsl(220, 25%, 12%);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 8px;
}

.blog-sidebar input {
    background-color: hsl(220, 25%, 15%) !important;
    border-color: rgba(0, 245, 255, 0.3) !important;
    color: #d0d0d0 !important;
}

.blog-sidebar input::placeholder {
    color: #666 !important;
}

/* ===== SECTION SPACING ===== */
.section {
    background: transparent;
    padding: 3rem 1.5rem;
}

/* ===== LOADING ===== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: hsl(220, 25%, 20%);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: hsl(185, 100%, 50%);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: hsl(185, 100%, 50%);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== BLAZOR ERROR ===== */
#blazor-error-ui {
    background: hsl(0, 60%, 20%);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== UTILITY ===== */
.text-cyan { color: hsl(185, 100%, 50%); }
.text-purple { color: hsl(270, 80%, 65%); }
.text-muted { color: #888; }

/* Bulma columns: zero out default negative margin for flush edges */
.columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: hsl(220, 25%, 10%); }
::-webkit-scrollbar-thumb { background: hsl(185, 100%, 30%); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(185, 100%, 50%); }
