/* ========================================================================
   FONT IMPORTS
   ======================================================================== */
@font-face {
    font-family: 'Asul';
    src: url('../font/Asul-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Asul';
    src: url('../font/Asul-Bold.ttf') format('truetype');
    font-weight: bold;
}

@font-face {
    font-family: 'Poppins';
    src: url('../font/Poppins/Poppins-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../font/Poppins/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
}

@font-face {
    font-family: 'Poppins';
    src: url('../font/Poppins/Poppins-Bold.ttf') format('truetype');
    font-weight: bold;
}

@font-face {
    font-family: 'Poppins';
    src: url('../font/Poppins/Poppins-Light.ttf') format('truetype');
    font-weight: 300;
}

/* ========================================================================
   GLOBAL BASE STYLES
   ======================================================================== */
body {
    font-family: 'Poppins' !important;
}

/* Tailwind Directives */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ========================================================================
   COLOR VARIABLES
   ======================================================================== */
@layer base {
    :root {
        --color-primary: 231 76 60;
        --color-secondary: 119 110 110;
        --color-text: 251 251 251;
        --white: 255 255 255;
        --dark: 0 0 0;
        --green: 0 147 0;
        --blue: 0 42 147;
        --yellow: 147 125 0;
        --red: 147 0 0;
        --bg-white: 255 255 255;
    }

    :root[class~="dark"] {
        --color-secondary: 171 171 171;
        --color-text: 0 0 0;
        --white: 0 0 0;
        --dark: 255 255 255;
        --bg-white: 0 0 0;
    }
}

/* ========================================================================
   ACTIVE STATES
   ======================================================================== */
.active\:bg-dark:active {
    background-color: var(--white);
}

/* ========================================================================
   TEXT FORMATTING
   ======================================================================== */
.text-primary {
    background: -webkit-linear-gradient(
        270deg,
        rgb(var(--color-primary)) 0%,
        color-mix(in srgb, rgb(var(--color-primary)) 70%, black) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========================================================================
   BUTTON STYLES
   ======================================================================== */
.bg-dark-btn {
    background: rgb(var(--bg-white)) !important;
}

.btn-primary {
    letter-spacing: 0.05em;
    font-family: 'Poppins';
    background: linear-gradient(
        180deg,
        rgb(var(--color-primary)) 0%,
        color-mix(in srgb, rgb(var(--color-primary)) 70%, black) 100%
    );
    border-radius: 9999px;
    padding: 0.875rem 2rem;
    margin-top: 1.75rem;
    margin-right: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.btn-outline-primary {
    color: rgb(var(--color-secondary));
    letter-spacing: 0.05em;
    font-family: 'Poppins';
    border: 1px solid rgb(var(--color-primary));
    border-radius: 9999px;
    padding: 0.75rem 2rem;
    margin-top: 1.75rem;
    transition: all 0.3s ease-in-out;
}

/* Hover Effects for Buttons */
.btn-primary:hover,
.btn-outline-primary:hover {
    transform: scale(0.9);
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   DROPDOWN MENU ARROW
   ======================================================================== */
#dropdownMenu::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -15px;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ========================================================================
   NAVIGATION MENU ACTIVE & HOVER EFFECTS
   ======================================================================== */
nav ul .active {
    margin: 5px 0 !important;
}

/* Top curve */
nav ul li:hover::before,
nav ul .active::before {
    content: '';
    position: absolute;
    top: -35px;
    right: -33px;
    width: 48px;
    height: 48px;
    background-color: rgb(var(--color-text));
    clip-path: path("M16 0C16 9 21 35 1 35L0.5 120.5L4.5 36H16V0Z");
}

/* Bottom curve */
nav ul li:hover::after,
nav ul .active::after {
    content: '';
    position: absolute;
    top: 28px;
    right: -33px;
    width: 48px;
    height: 48px;
    background-color: rgb(var(--color-text));
    clip-path: path("M16 59C16 50 21 24 1 24L0.5 -86.5L4.5 23H16V38Z");
}

/* RTL Mode - Navigation Shapes */
[dir=rtl] nav ul li:hover::before,
[dir=rtl] nav ul .active::before {
    right: auto;
    top: -15px;
    left: -15px;
    transform: rotate(90deg);
    clip-path: path("M16 0C16 9 21 35 4.5 35L0.5 120.5L4.5 36H16V0Z");
}

[dir=rtl] nav ul li:hover::after,
[dir=rtl] nav ul .active::after {
    right: auto;
    top: 23px;
    left: -24px;
    clip-path: path("M16 59C16 50 21 24 2 24L0.5 -86.5L4.5 23H16V38Z");
    transform: rotate(270deg);
}

/* ========================================================================
   DATATABLE & PAGINATION STYLING
   ======================================================================== */
.dt-container {
    padding: 10px;
}

.dataTables_wrapper {
    padding-top: 10px;
    padding-bottom: 10px;
}

.dataTables_wrapper tbody td {
    padding: 16px 10px !important;
}

/* Table Length & Info */
.dt-length label,
.dt-length select,
.dt-info {
    color: rgb(var(--color-secondary)) !important;
    font-family: 'Poppins';
}

.dt-column-title {
    font-size: 16px;
}

.dt-empty {
    text-align: center;
    padding: 50px 20px;
    font-size: 14px;
    color: var(--color-secondary);
}

/* Pagination Buttons */
.pagination .first,
.pagination .previous,
.pagination .next,
.pagination .last {
    background-color: var(--color-primary);
}

.dt-paging .pagination {
    border-color: rgb(var(--color-primary));
}

.dt-paging .pagination .active {
    background-color: rgb(var(--color-primary));
    border-color: rgb(var(--color-primary));
}

/* Custom Pagination Design */
.pagingContainer {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.prev-button,
.next-button,
.page-number {
    padding: 5px 10px;
    border: 1px solid rgb(var(--color-primary) / 0.5) !important;
    cursor: pointer;
    background: rgb(var(--white)) !important;
    color: rgb(var(--color-secondary)) !important;
    font-family: 'Poppins' !important;
    font-weight: 600;
}

.prev-button {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

.next-button {
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

.active-page {
    background: -webkit-linear-gradient(
        270deg,
        rgb(var(--color-primary)) 0%,
        color-mix(in srgb, rgb(var(--color-primary)) 70%, black) 100%
    ) !important;
    color: rgb(var(--white)) !important;
}

.page-number {
    color: rgb(var(--color-primary)) !important;
    font-weight: bold;
}

/* ========================================================================
   SIDEBAR STYLES
   ======================================================================== */
.side-item a {
    color: #ffffff;
    padding: 0.880rem 1.25rem;
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
    display: flex;
    align-items: center;
}

/* RTL Sidebar Adjustments */
[dir=rtl] .side-item:hover,
[dir=rtl] .side-item.active,
[dir=rtl] .side-item a {
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#sidebar,
#modal {
    z-index: 1;
}

/* Sidebar Active & Hover State */
.side-item:hover,
.active {
    background-color: rgb(var(--color-text) / var(--tw-bg-opacity, 1));
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
    --tw-bg-opacity: 0.5;
    padding-inline-start: 0.375rem;
    position: relative;
}

.side-item:hover a,
.active a {
    color: rgb(var(--dark) / var(--tw-text-opacity, 1)) !important;
    padding: 0.875rem !important;
    background-color: rgb(var(--color-text)) !important;
}

/* ========================================================================
   INPUT STYLES
   ======================================================================== */
.dt-container input::placeholder,
.custom-input::placeholder {
    font-weight: 400;
    font-family: 'Poppins';
    color: rgb(var(--color-secondary));
}

.custom-input {
    padding: 1rem 1.5rem;
    border: rgb(var(--color-secondary) / 0.15) 1px solid;
    color: rgb(var(--color-secondary));
    border-radius: 9999px;
    font-weight: 400;
    font-family: 'Poppins';
    background-color: rgb(var(--white));
}

/* Input Focus States */
.dt-container input:focus,
.custom-input:focus {
    outline-color: rgb(var(--color-primary) / 0.5);
}

/* Datatable Search Input */
.dt-search input {
    font-size: 16px;
    font-family: 'Poppins';
    color: rgb(var(--color-secondary));
    padding: 0.8rem 1rem;
    border-radius: 30px;
    border: 1px solid rgb(var(--color-primary));
    outline-color: rgb(var(--color-primary) / 0.5);
}

/* Datatable Length Selector */
.dt-length select {
    font-size: 16px;
    font-family: 'Poppins';
    color: rgb(var(--color-secondary));
    padding: 0.5rem;
    border: 1px solid rgb(var(--color-primary));
    outline-color: rgb(var(--color-primary) / 0.5);
}

/* ========================================================================
   TAB ACTIVE INDICATOR
   ======================================================================== */
.active-tab {
    background-color: rgb(var(--bg-white)) !important;
    color: rgb(var(--color-primary)) !important;
    font-weight: bold !important;
}

.active-tab::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -17px;
    width: 37px;
    height: 17px;
    background-color: rgb(var(--color-text));
    clip-path: path("M88 -21C16 49 20 -5 16 0L0.5 -55.5L4.5 -1H16V38Z");
}

.active-tab::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -15px;
    width: 37px;
    height: 17px;
    background-color: rgb(var(--color-text));
    clip-path: path("M-57 -23C16 49 16 -5 15 0L0.5 -55.5L4.5 -1H16V38Z");
}

/* ========================================================================
   RESPONSIVE MEDIA QUERIES
   ======================================================================== */
.mobile-only {
    display: none;
}

@media screen and (max-width: 1024px) {
    .mobile-only {
        display: block !important;
    }
}

@media screen and (max-width: 768px) {
    #dropdownMenu::after {
        top: -12px;
        right: 0px;
        transform: rotate(270deg);
    }
}

/* ========================================================================
   FORM VALIDATION
   ======================================================================== */
.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
}

.invalid-feedback.text-red-500 {
    color: #ef4444 !important;
}

/* ========================================================================
   DISABLED BUTTON STATE
   ======================================================================== */
.btn-restaurant:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================================================
   PHONE INPUT FORMATTING
   ======================================================================== */
input[type="text"][id*="phone"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* ========================================================================
   CUSTOM INPUT FOCUS & ERROR STATES
   ======================================================================== */
.custom-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-input.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ========================================================================
   SIDEBAR SCROLL AREA
   ======================================================================== */
aside nav {
    height: calc(100vh - 226px);
}
