/* Custom Styles for Doctor Management Admin Portal */

/* Animation Classes */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-out;
}

/* Loading Spinner Enhancement */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s ease;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Card Hover Effects */
.hover-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Table Row Hover */
tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
    transition: background-color 0.2s ease;
}

/* Modal Backdrop Animation */
.modal-backdrop {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Form Focus Effects */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transition: box-shadow 0.2s ease;
}

/* Button Press Effect */
button:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Chart Container */
canvas {
    max-height: 300px;
}

/* Schedule Grid Enhancements */
#weekly-schedule > div {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#weekly-schedule > div:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Status Badge Animations */
.status-badge {
    transition: all 0.2s ease;
}

.status-badge:hover {
    transform: scale(1.1);
}

/* Navigation Active State */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.bg-indigo-700::after {
    transform: translateX(0);
}

/* Print Styles */
@media print {
    nav, #loading, #alert-container, button {
        display: none !important;
    }
    
    .page {
        display: block !important;
        page-break-after: always;
    }
    
    .shadow {
        box-shadow: none !important;
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    nav .flex {
        flex-wrap: wrap;
    }
    
    nav .flex.space-x-4 {
        margin-top: 1rem;
        width: 100%;
        justify-content: space-around;
    }
    
    nav .flex.space-x-4 > * {
        margin: 0.25rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    .grid-cols-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Utility Classes */
.min-h-screen {
    min-height: 100vh;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 40;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Exception Card States */
.exception-card {
    transition: all 0.3s ease;
}

.exception-card.past {
    opacity: 0.6;
}

.exception-card:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom Select Dropdown Arrow */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Exception Calendar Styles */
.exception-block {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.exception-block.available {
    background-color: #3B82F6 !important;
    color: white !important;
}

.exception-block.available:hover {
    background-color: #2563EB !important;
    transform: scale(1.05);
    z-index: 10;
}

.exception-block.unavailable {
    background-color: #EF4444 !important;
    color: white !important;
}

.exception-block.unavailable:hover {
    background-color: #DC2626 !important;
    transform: scale(1.05);
    z-index: 10;
}

.time-slot {
    min-height: 80px;
    position: relative;
}

.time-slot:hover {
    background-color: #F9FAFB;
}

/* Calendar grid responsive adjustments */
@media (max-width: 1024px) {
    #exception-time-grid .exception-block {
        font-size: 10px;
        padding: 1px 3px;
    }
    
    #exception-time-grid .time-slot {
        min-height: 60px;
    }
}

/* Exception week navigation */
#exception-week-nav button:hover {
    background-color: #F3F4F6;
}

#exception-week-picker {
    cursor: pointer;
}
