html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #006bb7;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ========================================
   Main Layout Styles
   ======================================== */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 769px) {
    .page {
        flex-direction: row;
    }
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #1e2a38 0%, #2d3e50 100%);
    color: white;
    width: 100%;
}

@media (min-width: 769px) {
    .sidebar {
        width: 260px;
        min-height: 100vh;
        position: sticky;
        top: 0;
        flex-shrink: 0;
    }
}

/* Sidebar brand header */
.sidebar .navbar-brand-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .navbar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar .navbar-brand i {
    font-size: 1.5rem;
}

/* Sidebar navigation */
.sidebar .nav-menu {
    padding: 1rem 0.75rem;
}

.sidebar .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Top bar */
.top-bar {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-bar .user-email {
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.top-bar .btn-logout {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.top-bar .btn-logout:hover {
    color: #dc3545;
    background-color: #fee2e2;
}

/* Page content */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

@media (min-width: 769px) {
    .page-content {
        padding: 2rem;
    }
}

/* ========================================
   Error UI - Hidden by default
   ======================================== */

#blazor-error-ui {
    display: none;
    background: #fef3cd;
    border-top: 1px solid #ffc107;
    padding: 0.75rem 1.25rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.blazor-error-boundary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1rem;
    color: #721c24;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ========================================
   Mobile menu toggle
   ======================================== */

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .sidebar.show {
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #495057;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
    }

    .top-bar {
        justify-content: space-between;
    }
}

/* ========================================
   Ruleset Info Component
   ======================================== */

.ruleset-info {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    padding: 0.5rem;
    background-color: var(--bs-light);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.ruleset-version {
    cursor: help;
}

.ruleset-version:hover {
    color: var(--bs-primary);
}

.ruleset-warning {
    font-style: italic;
}

.ruleset-details {
    font-size: 0.9rem;
    background-color: white;
}

/* ========================================
   Keyboard Shortcut Tooltips
   ======================================== */

.sidebar-link[title] {
    position: relative;
}

/* Small shortcut badge shown on hover */
.sidebar-link[title]::after {
    content: attr(data-shortcut);
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.sidebar-link[title]:hover::after {
    opacity: 1;
}
