/* =========================================
   Gosei Website - Custom Styles
   ========================================= */

:root {
    /* Gosei Brand Colors (from logo) */
    --brand-blue:   #28A0DC;
    --brand-green:  #7CB43C;
    --brand-yellow: #F0B428;
    --brand-red:    #C83C28;
    --brand-purple: #9040A0;

    --primary: #28A0DC;
    --primary-dark: #1a86be;
    --primary-light: #e8f6fd;
    --font-main: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius: 0.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main) !important; color: #1e293b; line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }
img { max-width: 100%; height: auto; }

/* ---- Typography ---- */
.display-3, .display-4, .display-5 { font-weight: 800 !important; letter-spacing: -0.02em; }
.lead { font-size: 1.125rem; }

/* ---- Layout ---- */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* ---- Spacing ---- */
.py-6 { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.pb-6 { padding-bottom: 5rem !important; }
.pt-6 { padding-top: 5rem !important; }

/* ---- Hero ---- */
.hero-section {
    background: linear-gradient(rgba(5,15,30,.60), rgba(5,15,30,.70)),
                url('/images/hero-space-1.jpg') center/cover no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563eb' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* ---- Header ---- */
.site-header { position: relative; z-index: 1000; }
.navbar { transition: box-shadow .3s, background-color .3s; }
.navbar.scrolled { box-shadow: var(--shadow) !important; }
.navbar-brand { font-size: 1.5rem !important; }
.nav-link {
    font-weight: 500;
    color: #374151 !important;
    padding: 0.5rem 0.75rem !important;
    transition: color .2s;
    position: relative;
}
.nav-link:hover,
.nav-link.active { color: var(--primary) !important; }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}
.dropdown-menu { border: none; box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: .5rem; }
.dropdown-item { border-radius: 0.5rem; padding: .5rem .75rem; font-size: .9rem; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

/* ---- Cards ---- */
.card { border-radius: var(--radius) !important; transition: transform .25s ease, box-shadow .25s ease; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg) !important; }

/* ---- Buttons ---- */
.btn { font-weight: 500; border-radius: 0.5rem; transition: all .2s ease; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; transform: translateY(-1px); }
.btn-light:hover { background: #f1f5f9; transform: translateY(-1px); }

/* ---- Page Hero ---- */
.page-hero {
    background: linear-gradient(rgba(5,15,30,.62), rgba(5,15,30,.72)),
                url('/images/hero-city-1.jpg') center/cover no-repeat;
    padding: 5rem 0 !important;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: #fff !important; }
.page-hero p  { color: rgba(255,255,255,.75) !important; }

/* ---- Brand-colored Stats ---- */
.stat-number { font-size: 2.5rem; font-weight: 800; }
.stat-number.c-blue   { color: var(--brand-blue); }
.stat-number.c-green  { color: var(--brand-green); }
.stat-number.c-yellow { color: var(--brand-yellow); }
.stat-number.c-purple { color: var(--brand-purple); }

/* ---- Brand-colored Service Cards ---- */
.service-card { border-top: 3px solid transparent !important; transition: border-color .2s, transform .25s, box-shadow .25s; }
.service-card.c-blue   { border-top-color: var(--brand-blue)   !important; }
.service-card.c-green  { border-top-color: var(--brand-green)  !important; }
.service-card.c-yellow { border-top-color: var(--brand-yellow) !important; }
.service-card.c-red    { border-top-color: var(--brand-red)    !important; }
.service-card.c-purple { border-top-color: var(--brand-purple) !important; }
.service-card .svc-icon { font-size: 2.25rem; margin-bottom: .75rem; }
.service-card.c-blue   .svc-icon { color: var(--brand-blue);   }
.service-card.c-green  .svc-icon { color: var(--brand-green);  }
.service-card.c-yellow .svc-icon { color: var(--brand-yellow); }
.service-card.c-red    .svc-icon { color: var(--brand-red);    }
.service-card.c-purple .svc-icon { color: var(--brand-purple); }

/* ---- Stats Section ---- */
.stats-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ---- CTA Section ---- */
.cta-section {
    background: linear-gradient(135deg,
        var(--brand-blue)   0%,
        var(--brand-purple) 40%,
        var(--brand-red)    100%);
}

/* ---- Post Category ---- */
.post-card-category {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-blue);
    background: rgba(40,160,220,.12);
    padding: 3px 10px;
    border-radius: 100px;
}

.post-detail-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.15);
    padding: 3px 12px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,.3);
}

/* ---- Post Content ---- */
.post-content { font-size: 1.1rem; line-height: 1.85; color: #374151; }
.post-content h2,
.post-content h3 { margin-top: 2.5rem; margin-bottom: 1rem; color: #1e293b; }
.post-content p { margin-bottom: 1.5rem; }
.post-content img { max-width: 100%; border-radius: var(--radius); margin: 1.5rem 0; }
.post-content ul,
.post-content ol { padding-left: 1.75rem; margin-bottom: 1.5rem; }
.post-content li { margin-bottom: .5rem; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: #374151;
    margin: 2rem 0;
}
.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.post-content code { font-size: .875em; }
.post-content pre code { font-size: .9rem; }

/* ---- Related Posts Sidebar ---- */
.related-sidebar { padding-left: 8px; }

.related-sidebar-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}
.related-sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 24px;
}

.related-list { display: flex; flex-direction: column; gap: 20px; }

.related-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    text-decoration: none;
    transition: opacity .2s;
}
.related-item:hover { opacity: .7; }

.related-item-img {
    width: 72px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.related-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #cbd5e1;
    font-size: 1.2rem;
    border-radius: 8px;
    width: 72px;
    height: 56px;
    flex-shrink: 0;
}
.related-item-body { flex: 1; min-width: 0; }
.related-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.related-item.active .related-item-title { color: var(--primary); }
.related-item-date {
    font-size: 0.7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: gap .2s;
}
.related-view-all:hover { gap: 10px; }

/* ---- Footer ---- */
.site-footer { background: #0f172a !important; }
.hover-white { transition: color .2s; }
.hover-white:hover { color: white !important; }

/* ---- Badges ---- */
.bg-primary-subtle { background-color: var(--primary-light) !important; }

/* ---- Forms ---- */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(37,99,235,.15);
}

/* ---- Upload Dropzone ---- */
.upload-dropzone { cursor: pointer; transition: background .2s; border-style: dashed !important; }
.upload-dropzone:hover { background: rgba(37,99,235,.08) !important; }
.cursor-pointer { cursor: pointer; }

/* ---- Admin Dark Sidebar ---- */
.mud-drawer { border-right: none !important; }

/* Nav links in dark sidebar */
.mud-drawer .mud-nav-link {
    color: rgba(255,255,255,0.75) !important;
    border-radius: 6px !important;
    margin: 1px 8px !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    padding: 8px 12px !important;
    transition: background 0.15s, color 0.15s !important;
}
.mud-drawer .mud-nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.95) !important;
}
.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link[aria-current="page"] {
    background: rgba(59,130,246,0.2) !important;
    color: #60A5FA !important;
}
.mud-drawer .mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
    opacity: 0.85;
}

/* Nav group header in dark sidebar */
.mud-drawer .mud-nav-group .mud-nav-group-title {
    color: rgba(255,255,255,0.75) !important;
    border-radius: 6px !important;
    margin: 1px 8px !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    padding: 8px 12px !important;
    transition: background 0.15s !important;
}
.mud-drawer .mud-nav-group .mud-nav-group-title:hover {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.95) !important;
}
.mud-drawer .mud-nav-group .mud-nav-group-title .mud-icon-root {
    color: rgba(255,255,255,0.7) !important;
}
.mud-drawer .mud-nav-group .mud-nav-group-title .mud-nav-link-expand-icon {
    color: rgba(255,255,255,0.4) !important;
}

/* Nested nav links (inside groups) */
.mud-drawer .mud-nav-group .mud-nav-link {
    margin-left: 16px !important;
    padding-left: 16px !important;
    font-size: 0.8rem !important;
}

/* Section labels */
.nav-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: rgba(255,255,255,0.3);
    padding: 6px 20px 2px;
    text-transform: uppercase;
    user-select: none;
}

/* ---- Admin Form Cards ---- */
.admin-form-card {
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    background: #fff;
}
.form-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #3B82F6;
    text-transform: uppercase;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #F1F5F9;
}

/* Admin page header */
.admin-page-header {
    margin-bottom: 1.5rem;
}
.admin-page-header .page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}
.admin-page-header .page-subtitle {
    font-size: 0.875rem;
    color: #64748B;
}

/* Admin filter bar */
.admin-filter-bar {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 1rem;
}

/* Admin table card */
/* ---- Block Editor ---- */
.block-editor-item {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}
.block-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #F8FAFC;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}
.block-editor-header:hover { background: #F1F5F9; }
.block-editor-body {
    padding: 16px;
    border-top: 1px solid #E2E8F0;
    background: #fff;
}

.admin-table-card {
    border-radius: 10px !important;
    border: 1px solid #E2E8F0 !important;
    overflow: hidden;
}
.mud-table-head .mud-table-cell {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748B !important;
    background: #F8FAFC !important;
    border-bottom: 1px solid #E2E8F0 !important;
}
.mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none !important;
}

/* Dashboard stat cards */
.stat-card {
    border-radius: 12px !important;
    border: 1px solid #E2E8F0 !important;
    transition: box-shadow 0.2s, transform 0.2s !important;
}
.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px);
}
.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Utilities ---- */
.object-fit-cover { object-fit: cover; }
.inset-0 { top: 0; left: 0; right: 0; bottom: 0; }
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.border-2 { border-width: 2px !important; }
.rounded-4 { border-radius: 1rem !important; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .6s ease forwards; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.float { animation: float 3s ease-in-out infinite; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .py-6 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .hero-section { min-height: auto; padding: 5rem 0; }
    .display-3 { font-size: 2.25rem !important; }
    .display-4 { font-size: 2rem !important; }
    .display-5 { font-size: 1.75rem !important; }
}

/* ---- Blazor Error UI ---- */
#blazor-error-ui {
    background: #fef2f2;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid #fca5a5;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    font-size: 1.2rem;
}
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }
