html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f9fa;
}

/* Tool cards */
.tool-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: 0.75rem !important;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.tool-icon {
    font-size: 1.75rem;
    font-family: monospace;
    color: #0d6efd;
    font-weight: bold;
}

/* Ad slot placeholder (visible until AdSense is configured) */
.ad-slot-placeholder {
    border-style: dashed !important;
    background-color: #f1f3f5;
    color: #adb5bd;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Blazor error UI */
#blazor-error-ui {
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Navbar custom active link */
.nav-link-custom {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.875rem;
    font-weight: 500;
    background: none !important;
    border-radius: 0 !important;
    transition: color 0.15s ease;
}

.nav-link-custom:hover,
.nav-link-custom:focus {
    color: #fff !important;
    background: none !important;
}

.nav-link-custom.active {
    color: #ffc107 !important;
    background: none !important;
}

/* Regex cheat sheet table */
.regex-ref-table td:first-child {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0d6efd;
    white-space: nowrap;
    width: 1%;
}

/* Regex token breakdown cards */
.regex-breakdown {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
}

.token-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 8px 4px;
    border-radius: 6px;
    border: 1px solid;
    min-width: 36px;
    cursor: default;
    transition: filter 0.1s ease;
}

.token-card:hover {
    filter: brightness(0.93);
}

.token-card code {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
    background: none;
    padding: 0;
}

.token-card small {
    font-size: 0.62rem;
    white-space: nowrap;
    line-height: 1.2;
    opacity: 0.85;
}

.token-charclass  { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.token-anchor     { background: #f3e8ff; border-color: #c084fc; color: #7e22ce; }
.token-quantifier { background: #fef3c7; border-color: #fbbf24; color: #92400e; }
.token-group      { background: #dcfce7; border-color: #86efac; color: #15803d; }
.token-literal    { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.token-alternation{ background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* Navbar Tools dropdown */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #1a1f2b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.625rem;
    padding: 0.5rem 0.375rem;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.nav-dropdown-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 0.35rem 0.75rem 0.2rem;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.375rem;
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.nav-dropdown-item:hover {
    background-color: rgba(255,255,255,0.07);
    color: #fff !important;
}

.nav-dropdown-item.active {
    color: #ffc107 !important;
    background-color: rgba(255,193,7,0.08);
}

.nav-dropdown-icon {
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0d6efd;
    background: rgba(13,110,253,0.12);
    border-radius: 4px;
    padding: 1px 5px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.nav-dropdown-item.active .nav-dropdown-icon {
    color: #ffc107;
    background: rgba(255,193,7,0.12);
}

/* Desktop inline nav groups */
.nav-inline-group {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.1);
    padding-left: 1rem;
}

.nav-inline-items {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
}

.nav-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 3px 7px;
    border-radius: 5px;
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.nav-inline-link:hover {
    background-color: rgba(255,255,255,0.07);
    color: #fff !important;
}

.nav-inline-link.active {
    color: #ffc107 !important;
    background-color: rgba(255,193,7,0.08);
}

.nav-inline-link.active .nav-dropdown-icon {
    color: #ffc107;
    background: rgba(255,193,7,0.12);
}

.nav-inline-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.2);
    margin-top: 4px;
    text-align: center;
}

/* Mobile flat nav */
.mobile-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 0.6rem 1rem 0.2rem;
    list-style: none;
}

.nav-mobile-item {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem !important;
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: none !important;
    transition: color 0.1s ease;
}

.nav-mobile-item:hover {
    color: #fff !important;
}

.nav-mobile-item.active {
    color: #ffc107 !important;
    border-bottom: none !important;
}

.nav-mobile-item.active .nav-dropdown-icon {
    color: #ffc107;
    background: rgba(255,193,7,0.12);
}

/* Hamburger button */
.navbar-toggler-custom {
    display: none;
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.navbar-toggler-custom:hover {
    background-color: rgba(255,255,255,0.1);
}

@media (max-width: 1199.98px) {
    .navbar-toggler-custom {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-dropdown-menu {
        position: static;
        background: rgba(255,255,255,0.04);
        border: none;
        border-radius: 0.375rem;
        box-shadow: none;
        margin: 0.25rem 0 0.25rem 0.5rem;
    }
}

/* General */
.font-monospace {
    font-size: 0.875rem;
}

textarea.form-control {
    resize: vertical;
}
