/* Tailwind CSS Custom Styles */

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #2d3748;
}

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

.dark-mode ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

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

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Custom Focus Styles */
*:focus {
    outline: none;
}

/* Custom Selection Styles */
::selection {
    background-color: rgba(66, 153, 225, 0.3);
}

.dark-mode ::selection {
    background-color: rgba(66, 153, 225, 0.5);
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Custom Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Custom Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Custom Card Styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark-mode .card {
    background-color: #2d3748;
}

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

/* Custom Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.btn-primary {
    background-color: #4299e1;
    color: white;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-secondary {
    background-color: #a0aec0;
    color: white;
}

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

.btn-success {
    background-color: #48bb78;
    color: white;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-danger {
    background-color: #f56565;
    color: white;
}

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

/* Custom Input Styles */
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.dark-mode .input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: white;
}

.input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Custom Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background-color: #ebf8ff;
    color: #3182ce;
}

.dark-mode .badge-primary {
    background-color: rgba(49, 130, 206, 0.2);
    color: #63b3ed;
}

.badge-success {
    background-color: #f0fff4;
    color: #38a169;
}

.dark-mode .badge-success {
    background-color: rgba(56, 161, 105, 0.2);
    color: #68d391;
}

.badge-warning {
    background-color: #fffaf0;
    color: #d69e2e;
}

.dark-mode .badge-warning {
    background-color: rgba(214, 158, 46, 0.2);
    color: #faf089;
}

.badge-danger {
    background-color: #fff5f5;
    color: #e53e3e;
}

.dark-mode .badge-danger {
    background-color: rgba(229, 62, 62, 0.2);
    color: #fc8181;
}

/* Custom Toast Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #4299e1;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

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

.toast-success {
    background-color: #48bb78;
}

.toast-error {
    background-color: #f56565;
}

.toast-warning {
    background-color: #ed8936;
}

.toast-info {
    background-color: #4299e1;
}

/* Custom Loader Styles */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #3182ce;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Custom Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #1a202c;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1a202c transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* RTL specific adjustments */
[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .pl-2 {
    padding-left: 0;
    padding-right: 0.5rem;
}

[dir="rtl"] .pr-2 {
    padding-right: 0;
    padding-left: 0.5rem;
}

/* Dark mode toggle animation */
.dark-mode-toggle {
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: rotate(30deg);
}