/* ============================================
   MOB System - Main Stylesheet
   ============================================ */

@font-face {
    font-family: 'MyCustomFont';
    src: url('fonts/bootstrap-icons.woff2') format('woff2'), url('fonts/bootstrap-icons.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

/* Base Styles */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
}

/* Page Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #1a1c2c 0%, #2d3250 100%);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
}

/* Navigation */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s ease;
}

    .sidebar .nav-link:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar .nav-link.active {
        color: white;
        background: var(--primary-gradient);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

.sidebar .nav-item .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .text-muted {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Top Row */
.top-row {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    justify-content: flex-end;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

    .top-row ::deep a, .top-row ::deep .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row ::deep a:hover {
            text-decoration: underline;
        }

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

article.content {
    padding: 1.5rem;
    flex: 1;
}

@media (min-width: 768px) {
    article.content {
        padding: 2rem;
    }
}

/* Navbar Brand */
.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: white !important;
    letter-spacing: 0.5px;
}

    .navbar-brand i {
        color: var(--primary-color);
    }

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

    .card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    }

.card-header {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }

/* Tables */
.table {
    margin-bottom: 0;
}

    .table thead th {
        border-bottom: 2px solid #e9ecef;
        font-weight: 600;
        color: #6c757d;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 1rem;
    }

    .table tbody td {
        padding: 1rem;
        vertical-align: middle;
    }

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e1e5eb;
    padding: 0.625rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    }

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
}

/* Page Header */
.page-header h1 {
    color: #1a1c2c;
    font-weight: 700;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

    .breadcrumb-item a:hover {
        text-decoration: underline;
    }

/* Code */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
    color: #e83e8c;
}

/* Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    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;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Nav Scrollable */
.nav-scrollable {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Valid/Invalid States */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.bg-gradient-primary {
    background: var(--primary-gradient);
}

/* Toast Customization */
.success-toast {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.error-toast {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}
