/* Main Layout Styles */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

.content {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Sidebar Styling - Updated with new color scheme */
.sidebar {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%); /* Changed from blue to dark gray */
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.brand-container {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

/* Top Row Styling */
.top-row {
    height: 4rem;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 10;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.right-controls {
    display: flex;
    align-items: center;
}

/* User Info Styling */
.user-info {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 50px;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .user-info:hover {
        background-color: #e9ecef;
    }

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #4A5568; /* Updated color */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.user-role {
    font-size: 0.75rem;
    color: #6c757d;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0 0.5rem;
    margin-left: 0.5rem;
}

/* Footer Styling */
.footer {
    padding: 1rem 1.5rem;
    background-color: white;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Error UI Styling */
#blazor-error-ui {
    background: #fff8f8;
    border-top: 1px solid #f5c6cb;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.error-container {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
}

.error-icon {
    color: #dc3545;
    font-size: 1.25rem;
    margin-right: 1rem;
}

.error-message {
    flex: 1;
    color: #721c24;
}

#blazor-error-ui .reload {
    color: #dc3545;
    margin-left: 0.5rem;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: relative;
    margin-left: 1rem;
    color: #721c24;
}

/* NavMenu Styling */
.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Navbar Toggler for Mobile */
.navbar-toggler {
    appearance: none;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.navbar-toggler-label {
    display: none;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    margin: 0.75rem 1rem;
    position: relative;
}

    .navbar-toggler-label span,
    .navbar-toggler-label span::before,
    .navbar-toggler-label span::after {
        display: block;
        position: absolute;
        width: 1.5rem;
        height: 2px;
        background-color: white;
        transition: all 0.2s ease-in-out;
    }

    .navbar-toggler-label span {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

        .navbar-toggler-label span::before,
        .navbar-toggler-label span::after {
            content: '';
            left: 0;
        }

        .navbar-toggler-label span::before {
            top: -6px;
        }

        .navbar-toggler-label span::after {
            bottom: -6px;
        }

.navbar-toggler:checked + .navbar-toggler-label span {
    background-color: transparent;
}

    .navbar-toggler:checked + .navbar-toggler-label span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .navbar-toggler:checked + .navbar-toggler-label span::after {
        bottom: 0;
        transform: rotate(-45deg);
    }

/* Scrollable Nav Area */
.nav-scrollable {
    display: block;
    height: 100%;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

    /* Custom Scrollbar */
    .nav-scrollable::-webkit-scrollbar {
        width: 4px;
    }

    .nav-scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-scrollable::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
    }

/* Navigation Sections */
.nav-sections {
    padding: 1rem 0;
    flex: 1;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1.5rem;
    margin-top: 1rem;
}

.nav-items {
    margin-bottom: 1rem;
}

/* Navigation Items */
.nav-item {
    margin: 0.25rem 1rem;
}

    .nav-item .nav-link {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        transition: all 0.2s ease-in-out;
        position: relative;
        overflow: hidden;
    }

        .nav-item .nav-link::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background-color: #CBD5E0; /* Changed from blue */
            opacity: 0;
            transform: translateX(-4px);
            transition: all 0.2s ease-in-out;
        }

        .nav-item .nav-link:hover {
            color: white;
            background-color: rgba(255, 255, 255, 0.1);
        }

            .nav-item .nav-link:hover::before {
                opacity: 1;
                transform: translateX(0);
            }

        .nav-item .nav-link.active {
            color: white;
            background-color: rgba(255, 255, 255, 0.15);
        }

            .nav-item .nav-link.active::before {
                opacity: 1;
                transform: translateX(0);
            }

    /* Admin Role Custom Styling */
    .nav-item.role-admin .nav-link::before {
        background-color: #E53E3E; /* Changed to red for admin */
    }

/* Button styling - updated */
.btn-primary {
    background-color: #4A5568; /* Changed from blue */
    border-color: #4A5568;
}

    .btn-primary:hover {
        background-color: #2D3748;
        border-color: #2D3748;
    }

/* Form styling */
.form-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

    .form-section h4, .form-section h5 {
        color: #2D3748; /* Changed from blue */
        margin-bottom: 1.25rem;
        font-weight: 600;
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 0.75rem;
    }

/* Card styling */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header.bg-primary {
    background-color: #4A5568 !important; /* Changed from blue */
}

/* Dashboard Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    border-top: 4px solid #4A5568; /* Changed from blue */
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }

    .stat-card.danger {
        border-top-color: #E53E3E;
    }

    .stat-card.warning {
        border-top-color: #DD6B20;
    }

    .stat-card.success {
        border-top-color: #38A169;
    }

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #4A5568; /* Changed from blue */
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2D3748;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.8rem;
    color: #718096;
}

    .stat-change.positive {
        color: #38A169;
    }

    .stat-change.negative {
        color: #E53E3E;
    }

/* Responsive Styles */
@media (max-width: 640.98px) {
    .top-row {
        height: auto;
        padding: 1rem;
        flex-wrap: wrap;
    }

    .right-controls {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }

    .page-title {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}
