@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    body {
        @apply font-sans;
    }
}

.hidden {
    display: none;
}

/* Default styles (light mode) */
body {
    color: #000000;
    background-color: #ffffff;
    /* Light background for light mode */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* System preference: dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }

    body {
        background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
        /* Dark background */
        color: #ffffff;
        /* Light text */
    }

    /* Dark mode specific styles for MW tags */
    #mw-header-container,
    #mw-content-container,
    #mw-content,
    #p-banner,
    #page-tools,
    #site-navigation,
    #site-tools,
    #personal {
        background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1)) !important;
        /* Dark background */
        color: #ffffff !important;
        /* Light text */
    }

    /* Dark mode for links */
    a {
        color: #ffffff !important;
    }
}

/* Explicit dark mode */
html.dark body {
    background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
    color: #ffffff;
}

html.dark .header {
    background-color: transparent;
}

/* Light mode explicitly set */
html:not(.dark) body {
    background-color: #ffffff;
    color: #000000;
}

/* Theme toggle button styles */
#theme-toggle {
    background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
    /* Light background */
    border-radius: 50%;
    /* Round shape */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    /* Subtle shadow */
}

#theme-toggle:hover {
    background-color: #e0e0e0;
    /* Slightly darker on hover */
}

#theme-toggle-light-icon,
#theme-toggle-dark-icon {
    transition: opacity 0.3s ease;
}

/* Ensure dropdown has correct positioning */
#dropdown-menu {
    position: absolute;
    top: 100% !important;
    /* Position it just below the button */
    right: 0 !important;
    /* Align it to the right of the button */
    z-index: 50 !important;
    /* Ensure it is on top of other elements */
    display: none !important;
    /* Hide initially */
}

/* Style the dropdown when visible */
#dropdown-menu:not(.hidden) {
    display: block !important;
    /* Ensure the dropdown is displayed */
    opacity: 1 !important;
    /* Make sure it is fully visible */
    transform: scale(1) !important;
    /* Make sure it's not scaled down */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out !important;
}

/* Specific adjustments for MW tags */
#mw-header-container {
    position: inherit !important;
}

/* Hide specific MW elements */
#mw-header-hack,
#mw-header-nav-hack,
#footer-bottom {
    display: none !important;
}

#mw-content-container {
    background: inherit !important;
}

#mw-content,
#p-banner,
#mw-content-container,
#page-tools,
#site-navigation,
#site-tools,
#mw-header-container,
#personal {
    background: inherit !important;
    border: none !important;
    color: inherit !important;
}

/* Links styling */
a {
    background: inherit !important;
    border: none !important;
    text-decoration: none !important;
    color: inherit !important;
}

#mw-wrapper, #mw-header-container, #mw-content-container{
        @apply font-sans;
    }

/* Full screen popup */
#scanner-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}

/* Hide the popup initially */
#scanner-popup.hidden {
    display: none;
}

/* Camera container */
#scanner-container {
    position: relative;
    width: 80%;
    height: 80%;
    max-width: 600px;
    max-height: 600px;
    border: 5px solid #fff;
    border-radius: 10px;
}

/* Video element */
#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay for detection border */
#scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 40%;
    border: 2px solid rgba(0, 255, 0, 0.7);
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

/* Close button */
#close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #ff0000;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

#close-button:hover {
    background-color: #cc0000;
}

/* LOGO SWITCH */

/* Default (Dark Mode) */
html.dark {
    --logo-fill: #fff;
    /* White logo in dark mode */
}

/* Light Mode */
html.light {
    --logo-fill: #000;
    /* Black logo in light mode */
}

#quantity-modal.light {
    display: none; /* Hide the modal by default */
}
#quantity-modal.dark {
    display: none;
    background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));    /* Hide the modal by default */
}

/* Fixed widths for columns */
.fixed-column {
    width: 120px;  /* Adjust this value to fit the required column width */
    white-space: nowrap; /* Prevent wrapping */
}

/* Allow the "Customer" column to wrap text */
.customer-column {
    word-wrap: break-word;  /* Allow wrapping if text is too long */
    white-space: normal;    /* Allow normal wrapping */
}

/* Optional: Set the min-width for the 'Action' column if you want it fixed too */
th:last-child, td:last-child {
    width: 50px;
}

    /* Smooth event appearance */
    .fc-event {
        padding: 5px !important;  /* Adds spacing inside events */
        border-radius: 6px !important;  /* Rounded corners for a softer look */
        border-width: 0px !important;  /* Removes thick borders */
        box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2) !important; /* Adds a subtle shadow */
    }

    /* Improve text alignment */
    .fc-event-title {
        padding-left: 4px !important;  /* Adds space between text and left edge */
        font-size: 14px !important; /* Adjust text size for better readability */
    }

    .fc-daygrid-event {
        line-height: 1.4 !important; /* More spacing inside events */
        font-size: 14px !important;
    }

    /* Remove grid borders for a cleaner look */
    .fc-theme-standard .fc-scrollgrid {
        border: none !important;
    }

    /* Remove horizontal & vertical borders */
    .fc-theme-standard td, 
    .fc-theme-standard th {
        border-bottom: 1px solid rgba(76, 84, 95, 0.1) !important;
    }
    /* Add subtle lines between days */
    .fc-theme-standard .fc-daygrid-day {
        border-bottom: 1px solid rgba(76, 84, 95, 0.1) !important;
    }
    .fc {
        border-radius: 10px !important; /* Smooth rounded edges */
        overflow: hidden; /* Prevents content from breaking the rounded shape */
        box-shadow: 1px 4px 8px rgba(0, 0, 0, 0.15) !important; /* Subtle shadow for a modern look */
    }

    .fc-header-toolbar {
        padding: 8px 12px !important;
        background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1)) !important; /* Light background for a clean look */
        border-radius: 6px !important;
    }

    .fc-button {
        border-radius: 4px !important; /* Round the button corners */
        padding: 6px 12px !important;
        font-size: 14px !important;
        margin: 4px !important;
    }
    /* Custom Popup Styling */
    #eventPopup {
        display: none;
        background: white;
        color: #333;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
        max-width: 400px;
        min-width: 350px;
    }

    /* Dark Mode */
    .dark #eventPopup {
        background: #2d2d2d;
        color: white;
        border: 1px solid #555;
    }

    /* Title Color Dot */
    #popupColorIcon {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        display: inline-block;
    }

    /* Material Icons */
    .material-icons {
        font-size: 20px;
        vertical-align: middle;
    }

    /* Guest Avatars */
    #popupGuest img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 8px;
    }

    .customer-column {
        flex-grow: 2;
        min-width: 200px; /* Adjust as needed */
    }