/* Additional styles for Medication Schedule Manager */

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .grid {
    direction: rtl;
}

/* Medication names should remain LTR */
.medication-name {
    direction: ltr !important;
    text-align: left !important;
}

/* Smooth animations */
* {
    transition: all 0.2s ease;
}

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

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

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

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

/* Form enhancements */
.form-input:focus {
    outline: none;
    transform: translateY(-1px);
}

/* Button enhancements */
button {
    cursor: pointer;
    outline: none;
    border: none;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Medication item hover effects */
.medication-item:hover {
    border-left-width: 6px;
}

/* Print optimizations */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: white;
    }
    
    .medication-item {
        page-break-inside: avoid;
        margin-bottom: 20pt;
        border: 1px solid #ccc;
        padding: 10pt;
    }
    
    h1, h2, h3 {
        color: #000;
    }
    
    .bg-blue-500 {
        background-color: #3b82f6 !important;
        color: white !important;
    }
    
    .border-blue-500 {
        border-color: #3b82f6 !important;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert animations */
.custom-alert {
    transform: translateX(100%);
    opacity: 0;
}

.custom-alert.show {
    transform: translateX(0);
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .medication-item {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .medication-item .flex {
        flex-direction: column;
        gap: 12px;
    }
    
    .medication-item button {
        align-self: flex-end;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    border-color: #4f46e5;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
        border-color: #000;
    }
    
    button {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}