/* Custom styles for Convention Tools */

:root {
    color-scheme: light;
    --app-bg: #f3f5f8;
    --surface: #f9fbfd;
    --surface-strong: #ffffff;
    --sidebar-bg-start: #4f8791;
    --sidebar-bg-mid: #5e95a0;
    --sidebar-bg-end: #75aab2;
    --sidebar-border: rgba(255, 255, 255, 0.26);
    --sidebar-text: rgba(251, 255, 255, 0.96);
    --sidebar-muted: rgba(242, 251, 252, 0.78);
    --sidebar-hover: rgba(255, 255, 255, 0.2);
    --sidebar-active: rgba(255, 255, 255, 0.32);
    --sidebar-active-glow: rgba(31, 109, 119, 0.28);
    --accent: #1f6d77;
    --content-text: #1e2c31;
    --hero-start: #23406a;
    --hero-end: #1f4d57;
    --topbar-bg: rgba(19, 52, 62, 0.94);
    --topbar-btn-bg: rgba(255, 255, 255, 0.08);
    --topbar-btn-border: rgba(255, 255, 255, 0.2);
    --footer-text: #5c6970;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --app-bg: #0c1115;
        --surface: #121920;
        --surface-strong: #171f27;
        --sidebar-bg-start: #1a1a33;
        --sidebar-bg-mid: #1c2545;
        --sidebar-bg-end: #0f1730;
        --sidebar-border: rgba(151, 190, 255, 0.2);
        --sidebar-text: rgba(239, 246, 255, 0.95);
        --sidebar-muted: rgba(183, 201, 237, 0.8);
        --sidebar-hover: rgba(109, 144, 255, 0.18);
        --sidebar-active: rgba(133, 167, 255, 0.32);
        --sidebar-active-glow: rgba(105, 131, 255, 0.42);
        --accent: #8ba8ff;
        --content-text: #d9e2e8;
        --hero-start: #10192b;
        --hero-end: #1a3357;
        --topbar-bg: rgba(8, 17, 22, 0.96);
        --topbar-btn-bg: rgba(255, 255, 255, 0.08);
        --topbar-btn-border: rgba(255, 255, 255, 0.22);
        --footer-text: #9aabb4;
    }
}

body {
    background:
        radial-gradient(circle at top left, rgba(31, 109, 119, 0.16), transparent 30%),
        linear-gradient(180deg, var(--surface) 0%, var(--app-bg) 100%);
    color: var(--content-text);
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 288px;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-mid) 48%, var(--sidebar-bg-end) 100%);
    color: #fff;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 0 0 30px rgba(10, 20, 22, 0.18);
    z-index: 1030;
    overflow: hidden;
}

.sidebar-offcanvas {
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-mid) 48%, var(--sidebar-bg-end) 100%);
    color: #fff;
}

.sidebar-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: inline-flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    color: #fff;
}

.sidebar-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.sidebar-brand-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
}

.sidebar-user-meta {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
}

.sidebar-user-value {
    margin-top: 0.25rem;
    font-weight: 600;
    word-break: break-word;
}

.sidebar-nav-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1.25rem;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-wrap::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.sidebar-nav-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}

.sidebar-section-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sidebar-section-group summary {
    list-style: none;
}

.sidebar-section-group summary::-webkit-details-marker {
    display: none;
}

.sidebar-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-section-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-section-chevron {
    color: var(--sidebar-muted);
    transition: transform 0.18s ease;
}

.sidebar-section-group[open] .sidebar-section-chevron {
    transform: rotate(180deg);
}

.sidebar-section-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-section-title {
    margin-bottom: 0.2rem;
    padding: 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.theme-toggle-wrap {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0 0.35rem;
}

.sidebar-theme-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--sidebar-text);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.77rem;
    padding: 0.35rem 0.4rem;
}

.sidebar-theme-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-theme-btn.active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0.75rem var(--sidebar-active-glow);
}

.sidebar-link i {
    font-size: 1rem;
    width: 1.1rem;
}

.app-content-wrap {
    min-height: 100vh;
}

.app-main {
    padding: 1.4rem 1rem 2rem;
}

.app-footer {
    padding: 0 1rem 1.5rem;
    color: var(--footer-text);
    text-align: center;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1025;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn,
.mobile-profile-link {
    color: #fff;
    border: 1px solid var(--topbar-btn-border);
    background: var(--topbar-btn-bg);
}

.mobile-menu-btn:hover,
.mobile-profile-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.mobile-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.04em;
}

@media (min-width: 992px) {
    .app-content-wrap {
        margin-left: 288px;
    }

    .app-main {
        padding: 2rem 2rem 2.5rem;
    }

    .app-footer {
        padding: 0 2rem 1.5rem;
        text-align: left;
    }
}

.hero {
    color: #fff;
    background-color: var(--hero-start) !important;
    background-image: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%) !important;
}

.hero .btn.btn-light,
.hero .btn.btn-light * {
    color: #23406a;
}

.hero .btn.btn-outline-light {
    color: #fff;
    border-color: #fff;
    text-decoration: none;
}

.hero .btn.btn-outline-light:hover,
.hero .btn.btn-outline-light:focus {
    color: #23406a;
    background: #fff;
    border-color: #23406a;
}

.hero-section {
    background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%);
    color: #fff;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.pricing-card {
    transition: transform 0.2s ease-in-out;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card .card-header {
    border-bottom: none;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.feature-list li:last-child {
    border-bottom: none;
}

.tracking-number {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -23px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    border: 2px solid #fff;
}

.timeline-item.completed .timeline-marker {
    background: #28a745;
}

.timeline-content h6 {
    margin-bottom: 5px;
    color: #495057;
}

.timeline-item.completed .timeline-content h6 {
    color: #28a745;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%);
    border: none;
}

.btn-primary:hover {
    filter: brightness(1.05);
    border: none;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
    background: var(--surface-strong);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.features .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface-strong);
    margin: 0 auto 1rem;
    color: var(--hero-end);
}

.bi {
    vertical-align: -0.125em;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.cta {
    background: linear-gradient(135deg, var(--hero-end) 0%, var(--hero-start) 100%);
}

footer {
    margin-top: auto;
}

@media (prefers-color-scheme: dark) {
    /* Global text contrast */
    h1, h2, h3, h4, h5, h6 {
        color: #f0f4f9 !important;
    }

    p, li, span, div {
        color: #d9e2e8;
    }

    body {
        color: #d9e2e8;
    }

    /* Headings in specific contexts */
    .hero h1,
    .hero h2,
    .hero h3 {
        color: #fff !important;
    }

    /* Section headings */
    .hero-section h1,
    .hero-section h2,
    .hero-section h3 {
        color: #fff !important;
    }

    /* Bootstrap utility classes */
    .text-dark {
        color: #d9e2e8 !important;
    }

    .text-body {
        color: #d9e2e8 !important;
    }

    .text-body-secondary {
        color: #9fb0c9 !important;
    }

    .container-fluid > * {
        color: #d9e2e8;
    }

    /* Features section */
    .features.bg-light {
        background: #181f2a !important;
    }

    .features .display-5,
    .features h2 {
        color: #fff !important;
    }

    .features .lead.text-muted,
    .features p.lead {
        color: #b8cbff !important;
    }

    /* Cards and boxes */
    .card {
        background: #171f27;
        color: #d9e2e8;
    }

    .card-body {
        color: #d9e2e8;
    }

    .card-header {
        background: #202a36;
        color: #e8eef8;
        border-bottom: 1px solid #2f3b4e;
    }

    .card-title,
    .card-text {
        color: #d9e2e8;
    }

    /* Feature list */
    .feature-list li {
        border-bottom-color: #2f3b4e;
        color: #d9e2e8;
    }

    .feature-list li:last-child {
        border-bottom: none;
    }

    /* Tracking number */
    .tracking-number {
        background: #1a2332;
        border-color: #2f3b4e;
        color: #d9e2e8;
    }

    /* Timeline */
    .timeline::before {
        background: #2f3b4e;
    }

    .timeline-marker {
        background: #6c757d;
        border-color: #0c1115;
    }

    .timeline-content h6 {
        color: #e8eef8;
    }

    /* Tables */
    .table {
        color: #e4ecf7;
        border-color: #2f3b4e;
    }

    .table > :not(caption) > * > * {
        background-color: transparent;
        border-color: #2f3b4e;
        color: #d9e2e8;
    }

    .table-light,
    .table-light > th,
    .table-light > td,
    .table thead.table-light th {
        color: #e8eef8;
        background-color: #253142;
        border-color: #34465f;
    }

    .table-hover > tbody > tr:hover > * {
        background-color: rgba(139, 168, 255, 0.16);
        color: #f2f7ff;
    }

    .table a {
        color: #85a7ff;
    }

    .table a:hover {
        color: #b8cbff;
    }

    /* Forms */
    .form-label,
    label {
        color: #e8eef8;
    }

    .form-control,
    .form-select {
        background: #0f151c;
        color: #e4ecf7;
        border-color: #3a4a60;
    }

    .form-control:focus,
    .form-select:focus {
        background: #101923;
        color: #f3f7ff;
        border-color: #8ba8ff;
        box-shadow: 0 0 0 0.25rem rgba(139, 168, 255, 0.18);
    }

    .form-control::placeholder,
    .form-select::placeholder {
        color: #7f91aa;
    }

    .form-text {
        color: #9fb0c9 !important;
    }

    /* Modals */
    .modal-content {
        background: #141c24;
        color: #e4ecf7;
        border: 1px solid #2f3b4e;
        box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
    }

    .modal-header,
    .modal-footer {
        border-color: #2f3b4e;
    }

    .modal-title,
    .modal-body strong,
    .modal-body .form-label {
        color: #edf3ff;
    }

    .modal-body .text-muted,
    .modal-body .form-text {
        color: #9fb0c9 !important;
    }

    .modal .form-control {
        background: #0f151c;
        color: #e4ecf7;
        border-color: #3a4a60;
    }

    .modal .form-control:focus {
        background: #101923;
        color: #f3f7ff;
        border-color: #8ba8ff;
        box-shadow: 0 0 0 0.25rem rgba(139, 168, 255, 0.18);
    }

    .modal .form-control::placeholder {
        color: #7f91aa;
    }

    .modal .btn-close {
        filter: invert(1) grayscale(100%) brightness(180%);
    }

    .modal-backdrop.show {
        opacity: 0.72;
    }

    /* Alert boxes */
    .alert {
        color: #d9e2e8;
        border-color: #2f3b4e;
    }

    .alert-info {
        background-color: #0d2e45;
        border-color: #1a4d6d;
        color: #85d4ff;
    }

    .alert-warning {
        background-color: #4a3a0a;
        border-color: #7d6e1f;
        color: #ffd966;
    }

    .alert-danger {
        background-color: #45150d;
        border-color: #6d2a1a;
        color: #ff9999;
    }

    .alert-success {
        background-color: #0a3a1a;
        border-color: #1a6d3a;
        color: #66ff99;
    }

    /* Text utilities */
    .text-muted {
        color: #9fb0c9 !important;
    }

    .text-secondary {
        color: #a6b4c7 !important;
    }

    .lead {
        color: #c9d4e0;
    }

    /* Links */
    a {
        color: #85a7ff;
    }

    a:hover {
        color: #b8cbff;
    }

    /* Small text/captions */
    small {
        color: #9fb0c9;
    }

    /* Badges and pills */
    .badge {
        background-color: #0d6efd;
        color: #fff;
    }

    /* Pagination */
    .pagination .page-link {
        color: #85a7ff;
        background-color: #202a36;
        border-color: #2f3b4e;
    }

    .pagination .page-link:hover {
        color: #b8cbff;
        background-color: #2f3b4e;
        border-color: #3a4a60;
    }

    /* Breadcrumbs */
    .breadcrumb {
        background-color: #202a36;
        border-color: #2f3b4e;
    }

    .breadcrumb .breadcrumb-item {
        color: #9fb0c9;
    }

    .breadcrumb .breadcrumb-item.active {
        color: #d9e2e8;
    }

    /* Tooltips */
    .tooltip-inner {
        background-color: #333;
        color: #fff;
    }
}
