@tailwind base;
@tailwind components;
@tailwind utilities;

body.login-background {
    background-image: url('../assets/jru-pulse-index-bg1.png');
    background-position: left top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: auto 100vh;
}
.sidebar-transition {
    /* Defines the smooth slide animation for the sidebar width */
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-expanded {
    width: 16rem; /* 256px */
}

.sidebar-collapsed {
    width: 5rem; /* 80px */
}

.sidebar-collapsed .menu-text,
.sidebar-collapsed #logoContainer {
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease-out, visibility 0s 150ms;
}

/* Make the text and logo reappear smoothly when the sidebar expands. */
.sidebar-expanded .menu-text,
.sidebar-expanded #logoContainer {
    opacity: 1;
    visibility: visible;
    transition: opacity 300ms ease-in 100ms; /* Delay the fade-in slightly */
}

/* --- Dashboard-Specific Components --- */
.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 180px;
    }
}

/* Loading animation for charts */
.chart-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3a8a; /* JRU Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Styles for the date filter buttons on the dashboard */
.filter-btn {
    background-color: #f3f4f6;
    color: #4b5563;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    border: 1px solid #d1d5db;
}
.filter-btn.active {
    background-color: #1e3a8a; /* JRU Blue */
    color: #ffffff;
    font-weight: 600;
    border-color: #1e3a8a;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.filter-btn:hover:not(.active) {
    background-color: #e5e7eb;
}


.notification-item:hover {
    background-color: #f3f4f6;
}

.modal-overlay {
    transition: opacity 0.3s ease;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}


#userModal input[type="text"],
#userModal input[type="email"],
#userModal select,
#guestModal input[type="text"],
#guestModal input[type="email"],
#guestModal select {
    background-color: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;

    padding-top: 0.5rem;   
    padding-bottom: 0.5rem;
}

#userModal input[type="text"]:focus,
#userModal input[type="email"]:focus,
#userModal select:focus,
#guestModal input[type="text"]:focus,
#guestModal input[type="email"]:focus,
#guestModal select:focus {
    border-color: #1e3a8a !important;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.3);
    outline: none;
}

/* Notification Dropdown Styles */
#notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    z-index: 50;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 320px;
    max-width: 400px;
}

#notification-dropdown.is-visible {
    display: block;
}

.notification-item {
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f3f4f6;
}

#notification-list::-webkit-scrollbar {
    width: 8px; 
}
#notification-list::-webkit-scrollbar-track {
    background: #f1f5f9; 
}
#notification-list::-webkit-scrollbar-thumb {
    background: #94a3b8; 
    border-radius: 4px; 
}
#notification-list::-webkit-scrollbar-thumb:hover {
    background: #64748b; 
}


.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
     display: flex;
    border-radius: 50%;
    background-color: #ef4444; 
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    transform: translate(25%, -25%);
}

.notification-badge.hidden {
    display: none;
}


form[action="api/authenticate-local.php"] div:nth-of-type(2) {
    margin-top: 1.5rem; 
}

form[action="api/authenticate-local.php"] input[type="email"],
form[action="api/authenticate-local.php"] input[type="password"] {
    padding-top: 0.75rem;   
    padding-bottom: 0.75rem;
}

form[action="api/authenticate-local.php"] button[type="submit"] {
    padding-top: 0.75rem;  
    padding-bottom: 0.75rem;
    font-weight: 600; 
}

#userMenu {
    bottom: calc(100% + 0.5rem); 
}

#userMenu.hidden ~ #userMenuBtn i.fa-chevron-up {
    transform: rotate(180deg);
    transition: transform 0.2s ease-in-out;
}
#userMenu:not(.hidden) ~ #userMenuBtn i.fa-chevron-up {
    transform: rotate(0deg);
    transition: transform 0.2s ease-in-out;
}