/* Common Styles for Medical Rota Management System */

/* Alpine.js cloak utility */
[x-cloak] {
    display: none !important;
}

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Smooth transitions for sidebar */
.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

/* Custom scrollbar for sidebar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(to bottom right, rgb(249, 250, 251), rgb(243, 244, 246));
}

.dark .gradient-bg {
    background: linear-gradient(to bottom right, rgb(17, 24, 39), rgb(31, 41, 55));
}

/* Brand gradient for headers and buttons */
.brand-gradient {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(29, 78, 216));
}

.brand-gradient-hover:hover {
    background: linear-gradient(to right, rgb(29, 78, 216), rgb(30, 64, 175));
}

/* User avatar circle */
.user-avatar {
    background: linear-gradient(to bottom right, rgb(59, 130, 246), rgb(37, 99, 235));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark .card {
    background-color: rgb(31, 41, 55);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgb(229, 231, 235);
}

.dark .card-header {
    border-bottom-color: rgb(55, 65, 81);
}

.card-body {
    padding: 1.5rem;
}

/* Form input styles */
.form-input {
    display: block;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid rgb(209, 213, 219);
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: white;
    color: rgb(17, 24, 39);
}

.dark .form-input {
    background-color: rgb(31, 41, 55);
    border-color: rgb(55, 65, 81);
    color: rgb(243, 244, 246);
}

.form-input:focus {
    outline: none;
    border-color: rgb(59, 130, 246);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Date input styles */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    background-color: white;
    color: rgb(17, 24, 39);
    border: 1px solid rgb(209, 213, 219);
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    border-radius: 0.375rem;
}

.dark input[type="date"],
.dark input[type="time"],
.dark input[type="datetime-local"] {
    background-color: rgb(31, 41, 55);
    color: rgb(243, 244, 246);
    border-color: rgb(55, 65, 81);
}

/* Calendar icon in date inputs for dark mode */
.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

.dark input[type="date"]::-webkit-calendar-picker-indicator:hover,
.dark input[type="time"]::-webkit-calendar-picker-indicator:hover,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(29, 78, 216));
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: linear-gradient(to right, rgb(29, 78, 216), rgb(30, 64, 175));
}

.btn-secondary {
    background-color: white;
    color: rgb(55, 65, 81);
    border: 1px solid rgb(209, 213, 219);
}

.dark .btn-secondary {
    background-color: rgb(31, 41, 55);
    color: rgb(229, 231, 235);
    border-color: rgb(55, 65, 81);
}

.btn-secondary:hover {
    background-color: rgb(249, 250, 251);
}

.dark .btn-secondary:hover {
    background-color: rgb(55, 65, 81);
}

.btn-danger {
    color: rgb(220, 38, 38);
    background-color: transparent;
}

.dark .btn-danger {
    color: rgb(248, 113, 113);
}

.btn-danger:hover {
    background-color: rgb(254, 226, 226);
}

.dark .btn-danger:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

/* Alert/Message styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-left-width: 4px;
    border-left-style: solid;
    margin-bottom: 0.5rem;
}

.alert-success {
    background-color: rgb(240, 253, 244);
    border-left-color: rgb(34, 197, 94);
    color: rgb(21, 128, 61);
}

.dark .alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: rgb(134, 239, 172);
}

.alert-error {
    background-color: rgb(254, 226, 226);
    border-left-color: rgb(239, 68, 68);
    color: rgb(185, 28, 28);
}

.dark .alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: rgb(252, 165, 165);
}

.alert-warning {
    background-color: rgb(254, 243, 199);
    border-left-color: rgb(245, 158, 11);
    color: rgb(180, 83, 9);
}

.dark .alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: rgb(253, 224, 71);
}

.alert-info {
    background-color: rgb(239, 246, 255);
    border-left-color: rgb(59, 130, 246);
    color: rgb(29, 78, 216);
}

.dark .alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: rgb(147, 197, 253);
}

/* Icon utilities */
.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Text utilities */
.text-gradient {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(29, 78, 216));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation utilities */
.fade-enter {
    transition: opacity 0.3s ease-out;
}

.fade-enter-from {
    opacity: 0;
}

.fade-enter-to {
    opacity: 1;
}

/* Calendar-specific styles */
.calendar-day {
    min-height: 100px;
    position: relative;
}

.shift-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Standard shifts - different shades of green by clinician type */
.shift-standard-salaried {
    background-color: #dcfce7;
    color: #166534;
}

.dark .shift-standard-salaried {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.shift-standard-partner {
    background-color: #bbf7d0;
    color: #14532d;
}

.dark .shift-standard-partner {
    background-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.shift-standard-locum {
    background-color: #86efac;
    color: #064e3b;
}

.dark .shift-standard-locum {
    background-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

/* Non-standard shifts */
.shift-duty {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .shift-duty {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.shift-study-leave {
    background-color: #fef9c3;
    color: #854d0e;
}

.dark .shift-study-leave {
    background-color: rgba(234, 179, 8, 0.2);
    color: #fde047;
}

.shift-coroners {
    background-color: #fed7aa;
    color: #9a3412;
}

.dark .shift-coroners {
    background-color: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

/* Annual leave */
.shift-annual-leave {
    background-color: #fecaca;
    color: #991b1b;
    border: 2px dashed #991b1b;
}

.dark .shift-annual-leave {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: #f87171;
}

/* Requested days off (NOT_WORKING) */
.shift-requested-off {
    background-color: #e9d5ff;
    color: #6b21a8;
    border: 2px dotted #6b21a8;
}

.dark .shift-requested-off {
    background-color: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border-color: #a855f7;
}

.month-header {
    background-color: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #1f2937;
    font-size: 1.125rem;
}

.dark .month-header {
    background-color: rgb(31, 41, 55);
    border-bottom-color: rgb(55, 65, 81);
    color: rgb(229, 231, 235);
}

/* Alert icon styling for calendar */
.alert-icon {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    color: #ef4444;
    transition: color 0.2s;
}

.alert-icon:hover {
    color: #dc2626;
}

.dark .alert-icon {
    color: #f87171;
}

.dark .alert-icon:hover {
    color: #fca5a5;
}

/* Alert modal styling */
.alert-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.dark .alert-modal {
    background-color: rgba(0, 0, 0, 0.7);
}

.alert-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-modal-content {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark .alert-modal-content {
    background-color: rgb(31, 41, 55);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

.alert-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    border-left: 4px solid;
}

.alert-item.warning {
    background-color: #fef3c7;
    border-left-color: #f59e0b;
}

.dark .alert-item.warning {
    background-color: rgba(245, 158, 11, 0.2);
    border-left-color: #fbbf24;
    color: #fde047;
}

.alert-item.critical {
    background-color: #fee2e2;
    border-left-color: #ef4444;
}

.dark .alert-item.critical {
    background-color: rgba(239, 68, 68, 0.2);
    border-left-color: #f87171;
    color: #fca5a5;
}

.alert-close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
}

.alert-close:hover {
    color: #1f2937;
}

.dark .alert-close {
    color: #9ca3af;
}

.dark .alert-close:hover {
    color: #e5e7eb;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgb(243, 244, 246);
    border: 1px solid rgb(229, 231, 235);
}

.dark .dark-mode-toggle {
    background-color: rgb(55, 65, 81);
    border-color: rgb(75, 85, 99);
}

.dark-mode-toggle:hover {
    background-color: rgb(229, 231, 235);
}

.dark .dark-mode-toggle:hover {
    background-color: rgb(75, 85, 99);
}

.dark-mode-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: rgb(75, 85, 99);
}

.dark .dark-mode-toggle svg {
    color: rgb(234, 179, 8);
}