/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    height: 100vh;
    background-color: #f0f2f5;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    padding: 15px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header .logo {
    width: 180px;
    height: 40px;
    margin-right: 10px;
}

.sidebar-header .header-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 20px;
}

.menu-list li {
    margin-bottom: 5px;
}

.menu-list a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.menu-list a:hover {
    background-color: #e9ecef;
}

.menu-list a.active {
    background-color: #007bff;
    color: white;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.breadcrumb span {
    color: #555;
    font-size: 0.9em;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    margin-right: 15px;
    font-size: 0.9em;
    color: #333;
}

.user-info i {
    font-size: 1.2em;
    margin-left: 15px;
    color: #777;
    cursor: pointer;
}

/* Content Area (Container for Left Column + Map) */
.content-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

/* Left Column (Video + Camera Controls) */
.left-content-column {
    display: flex;
    flex-direction: column; 
    width: 100%;
    height: auto;
}

.live-video-pane {
    width: 100%;
    height: 200px; 
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#cameraVideo,
#cameraIframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
}

.video-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Camera Control Area (Search and Camera List) */
.camera-control-area {
    width: 100%;
    background-color: #ffffff;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 1;
    overflow-y: auto;
    max-height: 250px; 
}

.camera-control-area .camera-search {
    margin-bottom: 15px;
    padding-bottom: 0;
    border-bottom: none;
}

.camera-control-area .camera-search input {
    width: calc(100% - 20px);
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.camera-control-area .camera-list {
    overflow-y: auto;
}

.camera-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.camera-item:hover {
    background-color: #f8f9fa;
}

.camera-item-details {
    flex-grow: 1;
    font-size: 0.9em;
}

.camera-item-name {
    font-weight: bold;
    color: #333;
}

.camera-item-status {
    color: #888;
    font-size: 0.8em;
}

.camera-item-actions i {
    margin-left: 10px;
    color: #666;
    cursor: pointer;
}

/* Map Pane */
.map-pane {
    width: 100%; 
    flex-grow: 1; 
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
}

/* Custom Leaflet Marker Icons */
.leaflet-marker-icon.custom-camera-marker {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M12 12c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm0 2c-2.761 0-5 2.239-5 5h10c0-2.761-2.239-5-5-5zM12 0C7.863 0 4.5 3.363 4.5 7.5S12 24 12 24s7.5-12.863 7.5-16.5S16.137 0 12 0z"/></svg>');
    background-size: cover;
    width: 25px;
    height: 41px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}
.leaflet-marker-icon.custom-camera-marker.active {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23dc3545"><path d="M12 12c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm0 2c-2.761 0-5 2.239-5 5h10c0-2.761-2.239-5-5-5zM12 0C7.863 0 4.5 3.363 4.5 7.5S12 24 12 24s7.5-12.863 7.5-16.5S16.137 0 12 0z"/></svg>');
    background-size: cover;
    width: 25px;
    height: 41px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

/* Responsive Design for larger screens */
@media (min-width: 992px) {
    .content-area {
        flex-direction: row; 
    }

    .left-content-column {
        width: 25%; 
        height: 100%; 
    }

    .live-video-pane {
        width: 100%; 
        height: 250px; 
    }

    .camera-control-area {
        width: 100%;
        flex-grow: 1; 
        max-height: unset; 
    }

    .map-pane {
        width: 75%; 
        flex-grow: 1;
        height: 100%; 
    }
}