/* Custom styles for the application */

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: #343a40;
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
}

/* Sidebar Brand */
.sidebar-brand {
    height: 56px;
    padding: 0 20px;
    background-color: #2c3136;
    border-bottom: 2px solid #495057;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-brand .brand-link:hover {
    opacity: 0.8;
}

.sidebar-brand .brand-link i {
    font-size: 1.8rem;
    color: #ffffff;
}

.sidebar-brand .brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
}

/* Sidebar User Info */
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #2c3136;
    border-bottom: 1px solid #495057;
}

.sidebar-user .user-link {
    display: flex;
    align-items: center;
    color: #adb5bd;
    text-decoration: none;
    flex: 1;
    transition: color 0.2s ease;
}

.sidebar-user .user-link:hover {
    color: #fff;
}

.sidebar-user .user-link i {
    font-size: 1.2rem;
}

.sidebar-user .user-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-user .logout-form {
    margin: 0;
    padding: 0;
}

.sidebar-user .btn-logout {
    background: none;
    border: none;
    color: #adb5bd;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.sidebar-user .btn-logout:hover {
    color: #dc3545;
    transform: scale(1.1);
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 10px 0;
}

.sidebar-divider {
    height: 1px;
    background-color: #495057;
    margin: 10px 20px;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: #495057;
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #007bff;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 250px; /* Starts after sidebar */
    right: 0;
    height: 56px;
    z-index: 1050;
    background-color: #e9ecef !important;
    border-bottom: 3px solid #ced4da;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.top-header .nav-link {
    color: #212529;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.top-header .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 0.25rem;
}

.top-header .nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.15);
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    margin-top: 56px; /* Height of top header */
    padding: 20px;
    min-height: calc(100vh - 56px - 61px); /* viewport height - header - footer */
}

/* Footer */
.main-footer {
    position: relative;
    margin-left: 250px;
    padding: 15px 0;
    background-color: #f8f9fa;
    border-top: 3px solid #007bff; /* Separator line */
    font-size: 0.875rem;
}

/* Toast notifications styling */
.toast {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-header {
    border-bottom: none;
}

.toast-body {
    font-size: 0.9rem;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.login-card {
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Dropdown menu styling */
.dropdown-item form {
    margin: 0;
}

.dropdown-item button {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover button {
    background: none;
}

/* Sortable table columns */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.sortable:hover {
    background-color: #e3f2fd;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-250px);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .top-header {
        left: 0;
    }

    .main-content,
    .main-footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .top-header .nav-link {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .main-footer {
        font-size: 0.75rem;
        padding: 10px 0;
    }

    .sidebar-brand .brand-link {
        font-size: 1.25rem;
    }

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

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Card enhancements */
.card {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Table improvements */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Badge styling */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Button improvements */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #2c3136;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #5a6268;
}
