/**
 * JavaScript Component Styles
 * Styles for interactive components
 */

/* Calendar Styles */
.calendar-day {
    @apply relative p-2 text-center cursor-pointer rounded-lg transition-all;
    @apply hover:bg-dark-700 min-h-[80px] flex flex-col items-center justify-start;
}

.calendar-day.today {
    @apply bg-accent-500/20 border border-accent-500;
}

.calendar-day.has-appointments {
    @apply bg-dark-700/50;
}

.calendar-day.has-appointments:hover {
    @apply bg-dark-600 scale-105;
}

.calendar-day-empty {
    @apply p-2 min-h-[80px];
}

.calendar-day .day-number {
    @apply text-sm font-medium mb-1;
}

.calendar-day.today .day-number {
    @apply text-accent-400 font-bold;
}

.appointment-indicators {
    @apply flex gap-1 mt-auto;
}

/* File Upload Styles */
.drop-zone {
    @apply border-2 border-dashed border-dark-600 rounded-lg p-8 text-center cursor-pointer;
    @apply transition-all hover:border-accent-500 hover:bg-dark-700/30;
}

.drop-zone.drag-over {
    @apply border-accent-500 bg-accent-500/10 scale-105;
}

.file-preview {
    @apply mt-4;
}

.upload-progress {
    @apply mt-4 bg-dark-700 rounded-full overflow-hidden;
}

.progress-fill {
    @apply h-2 bg-accent-500 transition-all duration-300;
}

.progress-text {
    @apply text-sm text-center mt-2 text-dark-400;
}

.error-message {
    @apply mt-2 text-sm text-red-400;
}

/* Rating Selector Styles */
.rating-selector {
    @apply flex items-center gap-1;
}

.rating-selector .star {
    @apply cursor-pointer transition-transform;
}

.rating-selector .star:hover {
    @apply scale-110;
}

.rating-selector .star.filled {
    @apply scale-110;
}

.rating-label {
    @apply ml-3 text-sm font-medium text-dark-300;
}

/* Favorite Toggle Styles */
.favorite-toggle {
    @apply p-2 rounded-lg transition-all;
    @apply hover:bg-dark-700 hover:scale-110;
}

.favorite-toggle.favorited {
    @apply bg-red-500/10;
}

.favorite-toggle:disabled {
    @apply opacity-50 cursor-not-allowed;
}

/* Toast Notification Styles */
.toast-notification {
    @apply transform translate-y-full opacity-0;
    transition: all 0.3s ease-in-out;
}

/* Loading Overlay Styles */
.loading-overlay {
    @apply fixed inset-0 bg-black/50 z-50 flex items-center justify-center;
}

.loading-spinner {
    @apply animate-spin h-8 w-8 text-accent-500;
}

/* Modal Styles */
.modal-overlay {
    @apply fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4;
    @apply transition-opacity duration-300;
}

.modal-content {
    @apply bg-dark-800 rounded-lg p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto;
    @apply transform transition-all duration-300;
}

.modal-overlay.hidden {
    @apply opacity-0 pointer-events-none;
}

.modal-overlay.hidden .modal-content {
    @apply scale-95;
}

/* Dropdown Menu Styles */
.dropdown {
    @apply relative;
}

.dropdown-menu {
    @apply absolute right-0 mt-2 w-64 bg-dark-800 rounded-lg shadow-xl border border-dark-700;
    @apply transform transition-all duration-200 origin-top-right;
    @apply opacity-0 scale-95 pointer-events-none;
}

.dropdown-menu.open {
    @apply opacity-100 scale-100 pointer-events-auto;
}

/* Notification Dropdown Styles */
#notification-dropdown {
    @apply absolute right-0 mt-2 w-96 max-w-[calc(100vw-2rem)] bg-dark-800 rounded-lg shadow-xl border border-dark-700;
    @apply transform transition-all duration-200 origin-top-right;
    @apply max-h-[80vh] overflow-hidden flex flex-col;
}

#notification-dropdown.hidden {
    @apply opacity-0 scale-95 pointer-events-none;
}

#notification-list {
    @apply overflow-y-auto flex-1;
}

#notification-list::-webkit-scrollbar {
    @apply w-2;
}

#notification-list::-webkit-scrollbar-track {
    @apply bg-dark-900;
}

#notification-list::-webkit-scrollbar-thumb {
    @apply bg-dark-600 rounded-full;
}

#notification-list::-webkit-scrollbar-thumb:hover {
    @apply bg-dark-500;
}

/* Mobile Menu Styles */
#mobile-menu {
    @apply fixed inset-y-0 left-0 w-64 bg-dark-800 z-50;
    @apply transform transition-transform duration-300;
    @apply -translate-x-full;
}

#mobile-menu.open {
    @apply translate-x-0;
}

#menu-overlay {
    @apply fixed inset-0 bg-black/50 z-40;
    @apply transition-opacity duration-300;
    @apply opacity-0 pointer-events-none;
}

#menu-overlay.open {
    @apply opacity-100 pointer-events-auto;
}

/* Filter Form Styles */
.filter-form {
    @apply space-y-4;
}

.filter-form select,
.filter-form input[type="text"],
.filter-form input[type="search"],
.filter-form input[type="date"] {
    @apply w-full px-4 py-2 bg-dark-700 border border-dark-600 rounded-lg;
    @apply text-white placeholder-dark-400;
    @apply focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500;
    @apply transition-colors;
}

.filter-form label {
    @apply block text-sm font-medium text-dark-300 mb-1;
}

/* Badge Styles */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-success {
    @apply bg-green-500/20 text-green-400;
}

.badge-warning {
    @apply bg-yellow-500/20 text-yellow-400;
}

.badge-danger {
    @apply bg-red-500/20 text-red-400;
}

.badge-info {
    @apply bg-blue-500/20 text-blue-400;
}

/* Form Input Styles */
.input-field {
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field::placeholder {
    color: #6b7280;
}

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

.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-field.border-red-500 {
    border-color: #ef4444;
}

.input-field.border-red-500:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Textarea specific */
textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* Select specific */
select.input-field {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Button Styles */
.btn-primary {
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: #374151;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    padding: 0.5rem 1rem;
    background-color: #ef4444;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Sidebar Link Styles */
.sidebar-link {
    @apply flex items-center gap-3 px-4 py-3 rounded-lg text-dark-300;
    @apply hover:bg-dark-700 hover:text-white transition-colors;
}

.sidebar-link-active {
    @apply flex items-center gap-3 px-4 py-3 rounded-lg;
    @apply bg-accent-500/20 text-accent-400 font-medium;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

.animate-scale-in {
    animation: scaleIn 0.2s ease-out;
}

/* Utility Classes */
.gradient-primary {
    @apply bg-gradient-to-r from-accent-500 to-accent-600;
}

.text-gradient {
    @apply bg-gradient-to-r from-accent-400 to-accent-600 bg-clip-text text-transparent;
}

/* Mobile-Friendly Form Inputs */
@media (max-width: 640px) {
    /* Larger touch targets for mobile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="password"],
    select,
    textarea {
        @apply text-base; /* Prevents zoom on iOS */
        min-height: 44px; /* Apple's recommended minimum touch target */
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Larger buttons for mobile */
    button,
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .btn-danger {
        min-height: 44px;
        @apply text-base;
    }
    
    /* Better spacing for form fields */
    .input,
    .label {
        @apply text-base;
    }
    
    /* Optimize select dropdowns */
    select {
        @apply appearance-none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1.5em 1.5em;
        padding-right: 2.5rem;
    }
}

/* Responsive Utilities */
@media (max-width: 640px) {
    #notification-dropdown {
        @apply w-full max-w-full left-0 right-0 mx-4;
    }
    
    .modal-content {
        @apply p-4;
    }
}
