/* User Provided Account Template CSS */
:root {
    --sidebar-width: 280px;
    /* Updated Brand Colors */
    --primary-color: #F22E24;
    --primary-hover: #FB4031;
    --bg-light: #f3f4f6;
    --text-muted: #6b7280;
}

body {
    /* font-family: 'Inter', sans-serif; -- Inherit from theme instead of forcing */
    background-color: var(--bg-light);
    /* overflow-x: hidden; -- Can cause issues in some themes */
}

/* Layout */
#amorpdf-account-app {
    position: relative;
    width: 100%;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    /* position: fixed; -- Fixed might conflict with theme headers */
    /* height: 100vh; */
    /* overflow-y: auto; */
    z-index: 99;
    /* Lowered z-index slightly */
    transition: transform 0.3s ease;
    flex-shrink: 0;
    /* Prevent shrinking */
}

/* Make sidebar sticky instead of fixed for better theme compatibility */
@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}

.main-content {
    flex: 1;
    /* margin-left: var(--sidebar-width); -- Removed since using flexbox flow */
    padding: 2rem;
    width: 100%;
    /* Ensure full width */
    min-width: 0;
    /* Fix flex overflow */
}

/* Mobile Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100%;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
        padding-top: 4rem;
        /* Space for mobile toggle */
    }
}

/* Sidebar Navigation */
.nav-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1.5rem 1.5rem 0.5rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #374151;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none !important;
}

.nav-link:hover {
    background-color: #fef2f2;
    /* Light Red tint */
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #fef2f2;
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.nav-link i {
    width: 24px;
    margin-right: 0.5rem;
}

.nav-link.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

/* Flex Card Grid Styling */
.custom-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    /* Equivalent to g-4 */
}

.flex-card-item {
    flex: 1 1 300px;
    /* Grow, shrink, min-width 300px */
    min-width: 300px;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: white;
    height: 100%;
    transition: transform 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: white;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* Custom Form Controls */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    padding: 0.625rem 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(242, 46, 36, 0.1);
    /* Red tint shadow */
    outline: none;
}

.btn-primary-custom {
    /* Renamed to avoid theme conflict if needed, or stick to btn-primary */
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Social Buttons */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.social-btn.connected {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.badge-coming-soon {
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 0.65rem;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    margin-left: auto;
    border: 1px solid #e5e7eb;
}

/* Table Styling */
.table-hover tbody tr:hover {
    background-color: #fef2f2;
}

/* Status Badges */
.badge-status {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

.bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.bg-warning-subtle {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}

.bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

/* Footer Links */
.footer-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Mobile Toggle */
/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1002;
    /* Higher than overlay (1001) and sidebar (1000) */
    background: white;
    border: 1px solid #e5e7eb;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.mobile-toggle.moved {
    left: 295px;
    /* Sidebar (280px) + Padding (15px) */
    background: #fef2f2;
    color: var(--primary-color);
    border-color: #fca5a5;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dimmed background */
    z-index: 999;
    /* Below sidebar (1000) but above content */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.camera-badge-sa {
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-content: center !important;
    justify-content: center !important;
    align-items: center !important;
}

.profile-name-sa,
.dh-name,
.trigger-name {
    text-transform: capitalize;
}