/* Custom styles and animations for the Employee Management System */
:root {
    --p: 220 100% 50%;    /* primary */
    --pc: 220 100% 95%;   /* primary content */
    --su: 140 70% 40%;    /* success */
    --suc: 140 70% 95%;   /* success content */
    --er: 0 80% 50%;      /* error */
    --erc: 0 80% 95%;     /* error content */
    --bc: 0 0% 10%;       /* base content */
    --b2: 0 0% 96%;       /* light background */
    --b3: 0 0% 90%;
}

/* Fade-in animation for elements */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Slide-in animation for modals */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-box {
    animation: slideIn 0.3s ease-out;
}

/* Subtle hover effects */
.table tbody tr {
    transition: background-color 0.2s, transform 0.2s;
}

.table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: hsl(var(--p));
    color: hsl(var(--pc));
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background-color: hsl(var(--su));
    color: hsl(var(--suc));
}

.toast.error {
    background-color: hsl(var(--er));
    color: hsl(var(--erc));
}

/* Loading spinner */
.loader {
    border: 4px solid hsla(var(--b3));
    border-top: 4px solid hsl(var(--p));
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: hsla(var(--b2), 0.5);
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--bc) / 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--bc) / 0.6);
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: hsl(var(--bc) / 0.6);
}

.empty-state svg {
    margin: 0 auto 1rem auto;
    opacity: 0.5;
}

/* Dashboard card styles */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom form focus states */
.input:focus,
.select:focus {
    box-shadow: 0 0 0 2px hsl(var(--p) / 0.3);
}

/* Placeholder styling */
::placeholder {
    color: rgba(156, 163, 175, 0.7);  /* Gray color with opacity */
    opacity: 1;
}

:-ms-input-placeholder {
    color: rgba(156, 163, 175, 0.7);
}

::-ms-input-placeholder {
    color: rgba(156, 163, 175, 0.7);
}
