/* Aligns the support portal with the parent boxorandyos site (index.html). */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --site-bg: #f4f4f4;
    --site-text: #333;
    --site-muted: #555;
    --header-bg: #333;
    --header-text: #fff;
    --nav-bg: #444;
    --nav-link: #f2f2f2;
    --nav-hover: #555;
    --nav-active: #666;
    --card-bg: #fff;
    /* --support-brand is set per page in layouts/support.blade.php */
    --accent: var(--support-brand, #333);
    --brand-accent: var(--support-brand, #333);
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    background: var(--site-bg);
    color: var(--site-text);
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body:has(.nav-toggle-input:checked) { overflow-x: hidden; }

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--header-bg);
    color: #fff;
    padding: 8px 16px;
    z-index: 10001;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

.header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 24px 16px;
    text-align: center;
    border-bottom: 4px solid var(--brand-accent);
}
.header h1, .header .header-title {
    margin: 0;
    font-size: clamp(1.5em, 5vw, 2.5em);
}
.header p, .header .header-tagline {
    margin: 8px 0 0;
    font-size: clamp(1em, 2.5vw, 1.2em);
}

.nav-bar {
    background: var(--nav-bg);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 12px;
}
.nav-toggle { display: none; cursor: pointer; padding: 12px 12px 12px 0; min-height: 44px; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.nav-grid span { background: var(--nav-link); border-radius: 2px; transition: all 0.3s; }
.nav-toggle:hover .nav-grid span { background: #fff; }
.nav-page-name { color: var(--nav-link); font-size: 1rem; font-weight: 500; white-space: nowrap; }

.nav-bar a {
    color: var(--nav-link);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-bar a:hover { background: var(--nav-hover); }
.nav-bar a.active { background: var(--nav-active); }

.nav-links { display: flex; flex-wrap: wrap; }
.nav-bar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; }
.nav-bar-right form { margin: 0; display: inline-flex; align-items: center; }
.nav-bar-right button.nav-link-btn {
    background: none;
    border: none;
    color: var(--nav-link);
    font: inherit;
    cursor: pointer;
    padding: 14px 16px;
    min-height: 44px;
    transition: background 0.3s;
}
.nav-bar-right button.nav-link-btn:hover { background: var(--nav-hover); }

.nav-menu { display: none; }
.nav-shape { display: none; float: left; width: 0; height: 100vh; shape-outside: ellipse(50% 50% at 0% 50%); shape-margin: 0; }
.page-content { transition: padding-left 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links, .nav-bar-right { display: none !important; }
    .nav-bar .nav-menu {
        display: flex;
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        aspect-ratio: 1 / 2;
        max-height: 100vh;
        background: var(--nav-bg);
        border-radius: 0 9999px 9999px 0;
        z-index: 1000;
        overflow: hidden;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: stretch;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25);
    }
    .nav-toggle-input:checked ~ .nav-menu {
        width: min(48vw, 280px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-toggle-input:checked ~ .nav-toggle .nav-grid span { background: #666; border-radius: 50%; }
    .nav-menu a, .nav-menu button.nav-link-btn {
        display: block;
        width: 100%;
        padding: 14px 20px;
        min-width: auto;
        text-align: left;
        opacity: 0;
        transition: opacity 0.3s;
        text-decoration: none;
        color: var(--nav-link);
        background: none;
        border: none;
        font: inherit;
        cursor: pointer;
    }
    .nav-menu a:nth-child(1) { transition-delay: 0.08s; }
    .nav-menu a:nth-child(2), .nav-menu button:nth-child(2) { transition-delay: 0.1s; }
    .nav-menu a:nth-child(3) { transition-delay: 0.12s; }
    .nav-menu a:nth-child(4) { transition-delay: 0.14s; }
    .nav-menu a:nth-child(5) { transition-delay: 0.16s; }
    .nav-menu a:nth-child(6) { transition-delay: 0.18s; }
    .nav-menu a:nth-child(7), .nav-menu button:nth-child(7) { transition-delay: 0.2s; }
    .nav-menu a:nth-child(8) { transition-delay: 0.18s; }
    .nav-menu a:nth-child(9) { transition-delay: 0.16s; }
    .nav-menu a:nth-child(10) { transition-delay: 0.14s; }
    .nav-menu a:nth-child(11) { transition-delay: 0.12s; }
    .nav-menu a:nth-child(12) { transition-delay: 0.1s; }
    .nav-toggle-input:checked ~ .nav-menu a,
    .nav-toggle-input:checked ~ .nav-menu button.nav-link-btn { opacity: 1; }
    body:has(.nav-toggle-input:checked) .nav-shape {
        display: block;
        width: min(48vw, 280px);
        height: 100vh;
        margin: 0;
    }
    body:has(.nav-toggle-input:checked) .page-content {
        border-radius: 80px 0 0 80px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    }
}

#main-content .container,
main#main-content > .container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
@media (max-width: 600px) {
    #main-content .container, main#main-content > .container { margin: 12px; padding: 16px; }
}

.footer {
    background: var(--header-bg);
    color: #fff;
    padding: 20px;
    text-align: center;
    margin-top: 32px;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: #bbb; text-decoration: none; margin: 0 12px; }
.footer-links a:hover { color: #fff; }

/* —— Forms & components (Bootstrap-like class names used in Blade) —— */
.form-label { display: block; margin-bottom: 0.35rem; font-weight: 600; color: var(--site-text); }
.form-control, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

@supports (color: color-mix(in srgb, white, black)) {
    .form-control:focus, .form-select:focus {
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
    }
}
.form-control-sm { padding: 6px 10px; font-size: 0.9rem; }
textarea.form-control { min-height: 6rem; }
.is-invalid { border-color: #b02a37; }
.invalid-feedback { color: #b02a37; font-size: 0.875rem; margin-top: 0.25rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    filter: brightness(0.9);
    color: #fff;
}
.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); color: #fff; }
.btn-warning { background: #c9a227; color: #111; border-color: #b8941f; }
.btn-warning:hover { filter: brightness(1.05); }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }
.w-100 { width: 100%; }

.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row > * { padding: 0 8px; }
.g-2 { gap: 0; } .g-2 > * { margin-bottom: 8px; }
.g-3 > * { margin-bottom: 12px; }
.col-md-4, .col-md-5, .col-md-7, .col-md-8, .col-md-12 { flex: 1 1 100%; }
.col-auto { flex: 0 0 auto; }
.col-lg-8 { flex: 1 1 100%; max-width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
}
@media (min-width: 992px) {
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
}

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 8px; }

.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; } .pb-5 { padding-bottom: 3rem; }
.p-2 { padding: 0.5rem; } .p-4 { padding: 1.5rem; }
.me-2 { margin-right: 0.5rem; }

.text-muted { color: var(--site-muted) !important; }
.small { font-size: 0.875rem; }
.h3 { font-size: clamp(1.25em, 3vw, 1.75em); margin: 0 0 0.5rem; }
.h4 { font-size: clamp(1.1em, 2.5vw, 1.35em); margin: 0 0 0.5rem; }
.h6 { font-size: 1rem; margin: 0 0 0.5rem; }
.lead { font-size: 1.1em; color: var(--site-muted); }

.bg-white { background: #fff; }
.bg-light { background: #f8f8f8; }
.bg-warning-subtle { background: #fff8e6; }
.shadow-sm { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.rounded { border-radius: 8px; }
.border-bottom { border-bottom: 1px solid #e0e0e0; }

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    margin-bottom: 1rem;
}
.card-header {
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid #e8e8e8;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}
.card-body { padding: 16px; }

.list-group { list-style: none; margin: 0; padding: 0; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.list-group-flush { border: none; border-radius: 0; }
.list-group-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}
.list-group-flush .list-group-item { border-left: 0; border-right: 0; }
.list-group-item:last-child { border-bottom: none; }
.list-group-item-action { cursor: pointer; color: var(--accent); }
.list-group-item-action:hover { background: #f5f5f5; }

.table-responsive { overflow-x: auto; border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #e0e0e0; text-align: left; }
.table th { background: #f0f0f0; font-weight: 600; }
.table-sm th, .table-sm td { padding: 6px 8px; }

.progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.25s ease;
}

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 1rem; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }

.badge { display: inline-block; padding: 0.2em 0.5em; font-size: 0.75rem; border-radius: 4px; font-weight: 600; }
.text-bg-secondary { background: #6c757d; color: #fff; }
.text-bg-warning { background: #ffc107; color: #111; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.d-none { display: none !important; }
.d-inline { display: inline; }

.pagination { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 1rem 0 0; justify-content: center; }
.pagination .page-item { display: inline-block; }
.pagination .page-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    color: var(--accent);
    background: #fff;
}
.pagination .page-item.active .page-link { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }

.list-unstyled { list-style: none; padding-left: 0; margin: 0; }

.nav-bar-right .nav-user { color: #ccc; font-size: 0.85rem; padding: 8px 12px; align-self: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-org-switch { display: inline-flex; align-items: center; margin: 0 4px; }
.nav-org-select {
    max-width: 200px;
    font: inherit;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #666;
    background: #333;
    color: #eee;
    cursor: pointer;
}
.nav-menu .nav-org-switch { width: 100%; margin: 8px 0; padding: 0 12px; box-sizing: border-box; }
.nav-menu .nav-org-select { max-width: 100%; width: 100%; }
