/* M365 Audit Logs Portal - Custom Styles */

/* ===== Layout ===== */
body.has-sidebar {
    background-color: #f5f5f5;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 250px;
    background-color: #1f1f1f;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.sidebar-logo {
    font-size: 28px;
    color: #0078d4;
}

/* User info card */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background-color: #2a2a2a;
    margin: 0 10px 20px;
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #0078d4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav links */
.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-links li {
    margin-bottom: 2px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.nav-links a:hover {
    background-color: #2a2a2a;
    color: white;
}

.nav-links a.active {
    background-color: #0078d4;
    color: white;
    border-left: 4px solid #fff;
}

.nav-links a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Section headings */
.nav-section {
    color: #666;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 24px 6px !important;
    margin-bottom: 0 !important;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid #333;
    margin-top: auto;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background-color: #2a2a2a;
    color: #ff8787;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;
    background: #1f1f1f;
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* Main content */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 70px 15px 30px;
    }
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078d4 0%, #004578 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 15px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 4rem;
    color: #0078d4;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.login-body {
    text-align: center;
}

.login-info {
    color: #666;
    margin-bottom: 15px;
}

.login-restriction {
    color: #dc3545;
    font-weight: 500;
    margin-bottom: 25px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

.login-btn i {
    margin-right: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ===== Dashboard Stats Cards ===== */
.stats-card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}

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

.stats-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.stats-card .card-footer a {
    text-decoration: none;
}

.stats-card .card-footer a:hover {
    text-decoration: underline;
}

/* ===== Recent Activity Lists ===== */
.recent-activity .list-group-item {
    border-left: none;
    border-right: none;
    padding: 12px 16px;
}

.recent-activity .list-group-item:first-child {
    border-top: none;
}

/* ===== Tables ===== */
.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table th a {
    color: inherit;
}

.table th a:hover {
    color: #0078d4;
}

/* ===== Badges ===== */
.badge.bg-purple {
    background-color: #6f42c1 !important;
}

/* ===== Cards ===== */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

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

/* ===== Pagination ===== */
.pagination .page-link {
    border: none;
    margin: 0 2px;
    border-radius: 5px;
}

.pagination .page-item.active .page-link {
    background-color: #0078d4;
}

/* ===== Forms ===== */
.form-control:focus,
.form-select:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 0.2rem rgba(0, 120, 212, 0.25);
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: #0078d4;
    border-color: #0078d4;
}

.btn-primary:hover {
    background-color: #006cbe;
    border-color: #006cbe;
}

/* ===== Log Detail Modal ===== */
#logDetails {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stats-card .card-body {
        padding: 15px;
    }

    .stats-icon {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ===== Alert styles ===== */
.alert {
    border-radius: 8px;
}

.alert i {
    margin-right: 8px;
}

/* ===== Loading spinner ===== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

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