/* General Dashboard Layout */
body {
    font-family: 'Lato', sans-serif;
    /* This needs to be the orange background from your image */
    background-image: url('path/to/your/orange-background.png'); /* Or .jpg, etc. */
    background-size: cover; /* Adjust as needed: cover, contain, 100% 100% */
    background-position: center center;
    background-attachment: fixed; /* If you want it to stay fixed on scroll */
    background-color: #f8f9fa; /* Fallback color */
    overflow-x: hidden;
    min-height: 100vh;
}

.boxed-page {
    /* Your existing boxed-page styles */
    position: relative; /* Ensure it contains the dashboard-wrapper correctly */
    min-height: 100vh; /* Make sure it's at least viewport height */
    display: flex; /* Use flex to push footer down if you add one later */
    flex-direction: column;
    flex-grow: 1
}

#dashboard-main {
    flex-grow: 1; /* Allow dashboard section to take available space */
    padding: 0; /* Remove default section padding */
}

.dashboard-wrapper {
    display: flex;
    background-color: #f0f2f5; /* Slightly darker background for content area */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); /* Subtle shadow around the whole dashboard */
    border-radius: 8px; /* Slightly rounded corners */
    overflow: hidden; /* Ensures shadows and borders are contained */
    flex-grow: 1
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background-color: #343a40; /* Dark background */
    color: #f8f9fa; /* Light text */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    transition: all 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky; /* Keep sidebar in place */
    top: 0; /* Align to the top */
    height: 100vh; /* Full viewport height */
    overflow-y: auto; /* Enable scrolling for long content */
}

.sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    margin: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 5px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ced4da; /* Lighter grey for inactive links */
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-weight: 400;
    border-radius: 5px;
    margin: 0 10px;
}

.sidebar-nav .nav-link:hover {
    background-color: #495057; /* Darker grey on hover */
    color: #fff;
}

.sidebar-nav .nav-item.active .nav-link {
    background-color: #007bff; /* Primary blue for active item */
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

.sidebar-nav .nav-link i {
    margin-right: 15px;
    font-size: 1.2em;
    width: 25px; /* Fixed width for icon to ensure alignment */
    text-align: center;
}

.sidebar-nav .nav-item.logout {
    margin-top: auto; /* Pushes logout to the bottom */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 20px 30px; /* Padding inside the content area */
    background-color: #fff;
    position: relative; /* For the overlay on mobile */
    overflow-y: auto; /* Enable scrolling for content if it overflows */
    max-height: 100vh;
}

.header-navbar {
    margin-bottom: 20px;
    border-radius: 5px;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.content-sections {
    flex-grow: 1; /* Allow dashboard section to take available space */
    padding: 0; /* Remove default section padding */}

.dashboard-section {
    display: none; /* Hide all sections by default */
    animation: fadeIn 0.5s ease-in-out;
}

.dashboard-section.active {
    display: block; /* Show active section */
}

.section-title {
    margin-bottom: 25px;
    font-weight: 700;
    color: #343a40;
    border-bottom: 2px solid #007bff; /* A little highlight */
    padding-bottom: 10px;
    display: inline-block; /* Makes border-bottom fit content */
}

/* Card Styling */
.card {
    border: none;
    border-radius: 8px;
    margin-bottom: 20px; /* Spacing between cards */
}

.card-header {
    background-color: #f8f9fa; /* Lighter header for cards */
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 1rem 1.25rem;
}

.card-title {
    font-weight: 600;
    color: #343a40;
}

/* Table Styling for Domains */
.table {
    white-space: nowrap; /* Prevent wrapping in cells */
}

.table th, .table td {
    vertical-align: middle;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    color: #555;
    background-color: #f0f2f5;
}

.table tbody tr:hover {
    background-color: #e2e6ea;
}

/* Badges for Status */
.badge {
    padding: 0.5em 0.75em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.35rem;
}
.badge-success { background-color: #28a745; color: #fff; }
.badge-warning { background-color: #ffc107; color: #343a40; } /* Adjusted for visibility */
.badge-secondary { background-color: #6c757d; color: #fff; }

/* Form Elements */
.form-control {
    border-radius: 5px;
    box-shadow: none;
    border-color: #ced4da;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: #fff;
}

/* List group (for firewall rules/connected devices) */
.list-group-item {
    border-radius: 5px;
    margin-bottom: 5px;
    background-color: #fff;
}

/* Switch styling for Bootstrap 4 */
.form-check.form-switch {
    padding-left: 2.5em; /* Space for the switch */
}
.form-check-input {
    width: 2em;
    height: 1.25em;
    margin-left: -2.5em;
    background-color: #ced4da;
    border: 1px solid rgba(0, 0, 0, .25);
    border-radius: 1.25em;
    -webkit-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, -webkit-box-shadow .15s ease-in-out;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}
.form-check-input:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}


/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 767.98px) { /* Adjust for Bootstrap 'md' breakpoint */
    .dashboard-wrapper {
        flex-direction: column;
        border-radius: 0; /* No rounded corners on small screens */
        box-shadow: none; /* No shadow on small screens */
        min-height: 100vh; /* Full height */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -250px; /* Hide sidebar off-screen by default */
        height: 100vh;
        z-index: 1040; /* Above most content but below nav */
        box-shadow: 5px 0 10px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        left: 0; /* Slide in */
    }

    .main-content {
        padding: 15px;
        min-height: calc(100vh - 60px); /* Adjust for header-navbar */
        width: 100%;
        position: relative; /* For potential overlay */
    }

    .main-content.sidebar-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5); /* Dim overlay */
        z-index: 1030;
    }

    .header-navbar {
        margin-bottom: 15px;
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .section-title {
        text-align: center;
        margin-bottom: 20px;
    }
}

.edit-input {
    padding: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}