/* WSO Tools - Tailwind CSS Custom Styles */

/* Base Transitions */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Card Hover Effects */
.card-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.card-container:hover .card-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.card-container:hover .card-image {
    filter: blur(2px);
    transform: scale(1.05);
}

.card-image {
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Form Elements */
textarea:focus,
input:focus {
    outline: none;
}

/* Custom Scrollbar for Dark Mode */
.dark ::-webkit-scrollbar {
    width: 10px;
}

.dark ::-webkit-scrollbar-track {
    background: #1b1c1d;
}

.dark ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

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

/* Animation for buttons */
button, a {
    transition: all 0.2s ease;
}

/* Card shadow enhancement */
.card-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark .card-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark .card-shadow:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

/* Admin Panel Styles */
.admin-sidebar {
    transition: width 0.3s ease;
}

.admin-content {
    transition: margin-left 0.3s ease;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid;
}

.dark .data-table th,
.dark .data-table td {
    border-color: #333;
}

.data-table th {
    font-weight: 600;
}

.data-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.dark .data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

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

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.dark .badge-warning {
    background-color: rgba(234, 179, 8, 0.2);
    color: #fde047;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.dark .badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Form Input Styles */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
    color: #9ca3af;
}

.dark .form-input {
    background-color: #1b1c1d;
    border-color: #444;
    color: #e0e0e0;
}

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

.form-input:focus {
    border-color: #3b82f6;
    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);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background-color: #3b82f6;
    color: #fff;
}

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

.btn-success {
    background-color: #22c55e;
    color: #fff;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

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

.btn-secondary {
    background-color: #6b7280;
    color: #fff;
}

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

/* Stat Card */
.stat-card {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--from), var(--to));
    color: #fff;
}

.stat-card-blue {
    --from: #3b82f6;
    --to: #1d4ed8;
}

.stat-card-green {
    --from: #22c55e;
    --to: #16a34a;
}

.stat-card-purple {
    --from: #a855f7;
    --to: #7c3aed;
}

.stat-card-orange {
    --from: #f97316;
    --to: #ea580c;
}

/* =====================================================
   RTL (Right-to-Left) Support
   ===================================================== */

/* Base RTL Direction */
html[dir="rtl"] body,
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Flip flex direction for RTL */
html[dir="rtl"] .flex-row,
body.rtl .flex-row {
    flex-direction: row-reverse;
}

/* Table alignment for RTL */
html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td,
body.rtl .data-table th,
body.rtl .data-table td {
    text-align: right;
}

/* Form elements RTL */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
body.rtl input,
body.rtl textarea,
body.rtl select {
    text-align: right;
}

/* Admin sidebar RTL */
html[dir="rtl"] .admin-sidebar {
    right: 0;
    left: auto;
}

html[dir="rtl"] .admin-content {
    margin-right: 16rem;
    margin-left: 0;
}

/* Dropdown RTL positioning */
html[dir="rtl"] .dropdown-menu {
    left: 0;
    right: auto;
}

/* Icon spacing RTL - utility classes */
html[dir="rtl"] .icon-left {
    margin-left: 0.5rem;
    margin-right: 0;
}

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

/* List bullets RTL */
html[dir="rtl"] ul,
html[dir="rtl"] ol,
body.rtl ul,
body.rtl ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Breadcrumb separator RTL */
html[dir="rtl"] .breadcrumb-separator {
    transform: rotate(180deg);
}

/* Card content RTL */
html[dir="rtl"] .card-content,
body.rtl .card-content {
    text-align: right;
}

/* Pagination RTL */
html[dir="rtl"] nav .fa-chevron-left::before {
    content: "\f054"; /* Right arrow */
}

html[dir="rtl"] nav .fa-chevron-right::before {
    content: "\f053"; /* Left arrow */
}

/* Alert icons RTL */
html[dir="rtl"] .alert-icon {
    margin-left: 0.75rem;
    margin-right: 0;
}

/* Badge margin RTL */
html[dir="rtl"] .badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Modal close button RTL */
html[dir="rtl"] .modal-close {
    left: 1rem;
    right: auto;
}

/* Scrollbar RTL */
html[dir="rtl"] ::-webkit-scrollbar {
    direction: ltr;
}

/* Fix for space-x utility in RTL */
html[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}
