/*--  Overrides  --*/

/* == Components == */

/* Button styles are handled exclusively by DaisyUI theme in daisyui.css */
/* All button styling comes from the custom theme defined in daisyui.css */

.turbo-progress-bar {
    top: 4;
    left: 4;
    right: 4;
    height: 6px;
    @apply bg-primary rounded-lg;
}

/* Card styles are handled exclusively by DaisyUI theme in daisyui.css */
/* All card styling (background, borders, layout) is defined in daisyui.css */
/* This allows complete theme customization by changing only the DaisyUI theme */

.fieldset {
    .fieldset-legend {
        @apply text-base-content text-sm font-bold;
    }

    .input {
        input {
            padding-left: 0 !important;
            outline: none !important;
        }
    }
}

.table {
    thead {
        @apply bg-base-200 text-sm text-base-content;

        th {
            @apply font-medium;
        }
    }

    /* Customize zebra striping color - use DaisyUI theme colors */
    &.table-zebra {
        tbody tr:nth-child(even) {
            background-color: var(--color-base-200);
        }

        tbody tr:nth-child(odd) {
            background-color: var(--color-base-100);
        }
    }
}

/* Mobile: Remove card background when it contains responsive table */
@media (max-width: 767px) {
    /* Remove card background and border on mobile when it contains responsive table */
    .card:has(.responsive-table-mobile) {
        @apply bg-transparent border-0 shadow-none;
        padding: 0 !important;
    }
    
    .card:has(.responsive-table-mobile) .card-header {
        @apply bg-transparent border-0;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        }
    
    .card:has(.responsive-table-mobile) .card-footer {
        @apply bg-transparent border-0;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Fallback for browsers that don't support :has() */
    .responsive-table-mobile {
        /* This class is added to identify responsive tables */
    }
    
    /* Transform table cells into card fields */
    .responsive-table-mobile td {
        @apply block w-full p-0 border-0 m-0;
        display: block !important;
        width: 100% !important;
    }
    
    .responsive-table-mobile td:not(:last-child) {
        @apply mb-3 pb-3 border-b border-base-300;
    }
    
    /* Remove table-specific styles from cells */
    .responsive-table-mobile td span:first-child {
        @apply block mb-1;
    }
}

.menu {
    .menu-title {
        @apply text-base-content font-medium;
    }
}

/* == Tooltip Customization == */
.tooltip {
    --tooltip-text-color: var(--tooltip-content, var(--color-primary-content));
}

.tooltip::before {
    background-color: var(--tooltip-color) !important;
    color: var(--tooltip-text-color) !important;
}

.tooltip::after {
    border-top-color: var(--tooltip-color) !important;
    border-bottom-color: var(--tooltip-color) !important;
    border-left-color: var(--tooltip-color) !important;
    border-right-color: var(--tooltip-color) !important;
}

.timeline:not(.timeline-vertical)>li>hr {
    height: 2px;
}

.timeline.timeline-vertical>li>hr {
    width: 2px;
}

/* == Forms == */
.cally {
    ::part(button) {
        @apply font-sans;
    }
}

/* == Forms == */

.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}


.fieldset {
    .fieldset-legend {
        @apply text-base-content text-sm font-bold;
    }
}


.checkbox,
.radio,
.range,
.toggle {
    &:disabled {
        @apply opacity-35;
    }
}



input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-background-clip: text;
}

/* Enhanced Header Action Buttons */
.layout-sticky-header {

    /* Mobile bottom action bar improvements */
    .fixed.bottom-0 {
        /* Smooth slide-up animation for mobile action bar */
        animation: slideUpFadeIn 0.3s ease-out forwards;
    }
}

/* Mobile action bar animations */
@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered button entrance animation */
@keyframes buttonFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Safe area support for devices with notches */
.h-safe-area-inset-bottom {
    height: env(safe-area-inset-bottom, 0px);
}

/* Sidebar Toggle Button Icons */
.sidebar-toggle-btn {

    /* Default state: show menu icon, hide close icon */
    .sidebar-menu-icon {
        @apply block;
    }

    .sidebar-close-icon {
        @apply hidden;
    }
}

/* Mobile viewport with sidebar open (not collapsed) */
@media (max-width: 1023px) {
    .sidebar-menu:not(.collapsed) {
        .sidebar-toggle-btn {
            .sidebar-menu-icon {
                @apply hidden;
            }

            .sidebar-close-icon {
                @apply block;
            }
        }
    }
}

/* Desktop viewport: always show menu icon */
@media (min-width: 1024px) {
    .sidebar-toggle-btn {
        .sidebar-menu-icon {
            @apply block;
        }

        .sidebar-close-icon {
            @apply hidden;
        }
    }
}