body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    font-size: 12px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
@media (max-width: 768px) {
    /* Ensure the body allows vertical scrolling */
    body {
        overflow-y: auto; /* Enable vertical scrolling */
    }
}
.container {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}
.header-bar {
    background-color: #fdd835;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}
.tables-container {
    display: flex;
    justify-content: space-between;
    height: calc(100vh - 60px);
    gap: 40px;
}
.table-wrapper {
    width: calc(50% - 40px);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px 40px;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
/* Mobile View: Stack sections vertically */
@media (max-width: 768px) {
    .tables-container {
        flex-direction: column; /* Stack sections vertically */
        gap: 20px; /* Space between sections */
        height: auto; /* Let the container grow dynamically */
    }
    .table-wrapper {
        width: 100%; /* Full width for each section on mobile */
        padding: 15px 20px; /* Adjust padding for smaller screens */
    }
}
.section {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}
.row, .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    color: black;
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 5px;
    height: 20px;
}
.section-header {
    background-color: #009688;
    color: white;
}
.section-header .left, .row .left,
.section-header .right, .row .right {
    display: flex;
    align-items: center;
}
.left {
    flex: 1;
    display: flex;
    align-items: center;
}
@media (max-width: 768px) {
    .left {
        overflow: hidden; /* Ensure no overflow from the parent */
    }
}
.price-column {
    width: 60px;
    text-align: right;
    margin-right: 0; /* Adjust margin-right to 0 */
}
.controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 50px; /* Adjust margin-left to 50px */
}
@media (max-width: 768px) {
    .controls {
        margin-left: 5px; /* Adjust margin-left to 50px */
        width: 60px;
    }
}
.color-picker-wrapper {
    width: 60px;
    text-align: right;
    margin-right: 50px;
}
.color-picker-wrapper input[type="color"] {
    margin: 0;
    padding: 0;
    height: 20px;
    width: 50px;
}
.controls button {
    background: none;
    border: none;
    cursor: pointer;
    color: #616161;
    margin: 0;
    padding: 0;
    font-size: 18px;
}
.controls button:hover {
    color: #ff5722; /* Distinct hover color */
}
.drag-handle {
    cursor: grab;
    display: inline-block;
    width: 18px;
    height: 12px;
    background: repeating-linear-gradient(
        to bottom,
        #000,
        #000 2px,
        transparent 2px,
        transparent 4px
    );
    margin-right: 40px;
}
@media (max-width: 768px) {
    .drag-handle {
        cursor: grab;
        display: inline-block;
        width: 18px;
        height: 12px;
        background: repeating-linear-gradient(
            to bottom,
            #000,
            #000 2px,
            transparent 2px,
            transparent 4px
        );
        margin-right: 2px;
    }
}
.row .drag-handle {
    background-color: #fff;
}
.material-icons {
    vertical-align: middle;
    font-size: 18px;
}
.non-draggable {
    cursor: not-allowed;
}
.hidden {
    display: none;
}
.first-row-fixed {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: white;
}
/* Toggle switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 36px; /* Reduced width by 40% */
    height: 20px; /* Reduced height by 40% */
    margin-left: 10px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px; /* Reduced height by 40% */
    width: 14px; /* Reduced width by 40% */
    left: 3px; /* Adjusted to fit the smaller switch */
    bottom: 3px; /* Adjusted to fit the smaller switch */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #2196F3;
}
input:checked + .slider:before {
    transform: translateX(16px); /* Adjusted for the smaller switch */
}
.editable {
    width: 300px;
    border: 1px solid #ddd;
    padding: 2px 5px;
    border-radius: 3px;
    background-color: #fff;
    display: inline-block;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflowed text */
    text-overflow: ellipsis; /* Show ellipsis for overflowed text */
    min-width: 100px;
}
.editable.editing {
    white-space: normal !important;
    overflow: visible !important;
}
@media (max-width: 768px) {
    .editable {
        display: inline-block; /* Allows for block-like behavior */
        max-width: 100%; /* Constrain to parent width */
        white-space: nowrap; /* Prevent text wrapping */
        overflow: hidden; /* Hide overflowed text */
        text-overflow: ellipsis; /* Show ellipsis for overflowed text */
        min-width: 25%;
        width: 100%;
    }
    .editable.editing {
        white-space: normal !important;
        overflow: visible !important;
        position: relative;
    }
}
.editable:focus {
    outline: none;
    border-color: #009688;
    background-color: #f0f0f0;
}

.editable.hidden-border {
    border: none;
    background-color: transparent;
}

.editing {
    color: black !important;
}

.price-column-video {
    width: 125px;
    text-align: left;
    position: relative;
}
@media (max-width: 768px) {
    .price-column-video {
        width: 25%; /* Make width flexible */
        max-width: 100%; /* Ensure it doesn’t exceed container */
        text-align: left; /* Keep text aligned to the left */
    }
}

.price-column-video .editable {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}
.price-column-video .editable.editing {
    white-space: normal !important;
    overflow: visible !important;
}

.price-column-video .editable:hover::after {
    content: attr(data-full-text);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.price-column-video .editable:hover::after {
    opacity: 1;
}

/* For item text on video screen */
.item-text-video {
    width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    position: relative;
}
@media (max-width: 768px) {
    .item-text-video {
        width: 100%;
        max-width: 100%; /* Ensure flexible width on smaller devices */
        white-space: nowrap; /* Allow wrapping on small screens */
        text-overflow: ellipsis; /* Prevent ellipsis if wrapping is preferred */
        display: inline-block; 
        overflow: hidden;
    }
}

.item-text-video.editing {
    white-space: normal !important;
    overflow: visible !important;
}

.item-text-video:hover::after {
    content: attr(data-full-text);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-text-video:hover::after {
    opacity: 1;
}
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 1000;
}

.message.success {
    background-color: #4caf50;
    color: #fff;
}

.message.error {
    background-color: #f44336;
    color: #fff;
}
.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    font-weight: bold;
    color: #333;
}

.logout-button {
    background-color: #ff5722;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}

.logout-button:hover {
    background-color: #e64a19;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    border-radius: 3px;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: #3e8e41;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #ddd; /* Add a border to the dropdown content */
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s, color 0.3s; /* Add transition for smooth hover effect */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #2196F3; /* Change the hover text color */
}

.dropdown:hover .dropdown-content {
    display: block;
}

@media (max-width: 768px) {
    .header-bar {
        flex-direction: column; /* Stack items vertically */
    }

    .user-info {
        width: 100%; /* Take full width */
        order: -1; /* Move username to the first row */
        display: flex; /* Keep username and dropdown aligned */
        align-items: center; /* Align items vertically */
    }

    .header-bar > div {
        width: 100%; /* Ensure all divs take full width */
    }

    .dropdown-content {
        display: none; /* Hide dropdown by default */
        position: absolute; /* Ensure proper positioning */
        z-index: 1; /* Make sure it appears above other elements */
    }

    .dropdown:hover .dropdown-content {
        display: block; /* Show dropdown on hover */
    }

    .dropbtn {
        flex-shrink: 0; /* Prevent button from shrinking */
    }
    .user-info .dropbtn,
    .user-info .logout-button {
        background: none; /* Remove default background */
        border: none; /* Remove border */
        padding: 0; /* Remove padding */
        cursor: pointer; /* Change cursor to pointer */
        font-size: 0; /* Hide text content */
    }

    .user-info .dropbtn::before {
        content: "\f0c9"; /* Font Awesome icon for menu */
        font-family: "Font Awesome 5 Free"; /* Specify font family */
        font-weight: 900; /* Use solid style */
        font-size: 16px; /* Adjust icon size */
        color: #333; /* Change to a more visible color */
    }

    .user-info .logout-button::before {
        content: "\f2f5"; /* Font Awesome icon for logout */
        font-family: "Font Awesome 5 Free"; /* Specify font family */
        font-weight: 900; /* Use solid style */
        font-size: 16px; /* Adjust icon size */
        color: #333; /* Change to a more visible color */
    }
    .header-bar > div:first-child {
        margin-top: 10px; /* Add space below the first row */
    }
}

