/* Custom styles for Nawaf's Platform */

/* Color Variables */
:root {
    --color-primary: #CE2E26;
    --color-secondary: #3A8478;
    --color-background: #1A2033;
}

/* Smooth transitions for interactive elements */
a, button, input, select, textarea {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2a3347;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2f6b62;
    background: #555;
}

/* Loading spinner utility */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(58, 132, 120, 0.2);
}

/* Button animations */
.btn {
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: #2f6b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(58, 132, 120, 0.3);
}

.btn-secondary {
    background-color: var(--color-secondary);
}

.btn-secondary:hover {
    background-color: #38b8d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(69, 207, 239, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Button animations */
.btn-primary {
    @apply bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-lg;
}

/* Form input styles */
.input-field {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #374151;
    background-color: #2a3347;
    color: white;
    border-radius: 0.5rem;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(58, 132, 120, 0.1);
    @apply w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: #242b3d;
    @apply overflow-x-auto shadow-md rounded-lg;
}

.table-striped tbody tr:nth-child(odd) {
    @apply bg-gray-50;
}

/* Row actions dropdown */
.event-row {
    position: relative;
    z-index: 0;
    overflow: visible;
}

.event-row.is-open {
    z-index: 50;
}

.row-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    z-index: 1;
}

.row-actions.is-open {
    z-index: 30;
}

.row-actions-trigger {
    opacity: 0;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    background-color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.event-row:hover .row-actions-trigger,
.row-actions:focus-within .row-actions-trigger,
.row-actions.is-open .row-actions-trigger {
    opacity: 1;
    transform: translateY(-1px);
    background-color: #1f2937;
}

.row-actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    margin-top: 6px;
    padding: 6px 0;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(5, 8, 15, 0.6);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    z-index: 80;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.row-actions:focus-within .row-actions-menu,
.row-actions.is-open .row-actions-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.row-actions-item {
    width: 100%;
    text-align: right;
    padding: 8px 12px;
    color: #e2e8f0;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.row-actions-item:hover {
    background-color: #1f2937;
}

.row-actions-danger {
    color: #fca5a5;
}

/* Dark row actions variant */
.row-actions--dark .row-actions-trigger {
    color: #e2e8f0;
    background-color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.row-actions--dark .row-actions-trigger:hover {
    background-color: #1f2937;
}

.row-actions--dark .row-actions-menu {
    background-color: #0f172a;
    border-color: #334155;
    box-shadow: 0 14px 28px rgba(5, 8, 15, 0.6);
}

.row-actions--dark .row-actions-item {
    color: #e2e8f0;
}

.row-actions--dark .row-actions-item:hover {
    background-color: #1f2937;
}

.row-actions--dark .row-actions-danger {
    color: #fca5a5;
}

.event-date-cell {
    position: relative;
    padding-right: 48px;
}

[dir="rtl"] .row-actions {
    left: 8px;
    right: auto;
}

[dir="rtl"] .row-actions-menu {
    left: 0;
    right: auto;
}

[dir="rtl"] .event-date-cell {
    padding-left: 48px;
    padding-right: 16px;
}

@media (max-width: 640px) {
    .row-actions {
        right: 4px;
    }

    [dir="rtl"] .row-actions {
        left: 4px;
        right: auto;
    }

    .row-actions-trigger {
        opacity: 1;
    }

    .event-date-cell {
        padding-right: 44px;
    }

    [dir="rtl"] .event-date-cell {
        padding-left: 44px;
        padding-right: 12px;
    }
}


/* Alert/notification styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(58, 132, 120, 0.2);
    border: 1px solid var(--color-primary);
    color: #6ee7b7;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fcd34d;
}

.alert-info {
    background-color: rgba(69, 207, 239, 0.2);
    border: 1px solid var(--color-secondary);
    color: #7dd3fc;
    @apply p-4 rounded-lg mb-4;
}

.alert-success {
    @apply bg-green-100 border border-green-400 text-green-700;
}

.alert-error {
    @apply bg-red-100 border border-red-400 text-red-700;
}

.alert-warning {
    @apply bg-yellow-100 border border-yellow-400 text-yellow-700;
}

.alert-info {
    @apply bg-blue-100 border border-blue-400 text-blue-700;
}

/* RTL-specific adjustments */
[dir="rtl"] .float-left {
    float: right;
}

[dir="rtl"] .float-right {
    float: left;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}
