/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Cairo', 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #1f2937;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Smooth transitions */
* {
    --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.sidebar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    left: 0;
    right: auto;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* Position sidebar correctly for LTR and RTL and animate off-screen */
html[dir="ltr"] .sidebar { transform: translateX(-100%); left: 0; right: auto; }
html[dir="rtl"] .sidebar { transform: translateX(100%); right: 0; left: auto; }
html[dir="ltr"] .sidebar.open { transform: translateX(0); }
html[dir="rtl"] .sidebar.open { transform: translateX(0); }

.sidebar-overlay {
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.main-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    html[dir="ltr"] .sidebar { transform: translateX(0); }
    html[dir="rtl"] .sidebar { transform: translateX(0); }
    html[dir="ltr"] .main-content { margin-left: 280px; }
    html[dir="rtl"] .main-content { margin-right: 280px; }
    .sidebar-overlay { display: none; }
}

[data-lang-key] {
    font-family: 'Poppins', 'Open Sans', sans-serif;
}

html[dir="rtl"] [data-lang-key] {
    font-family: 'Cairo', 'Poppins', sans-serif;
}

.active-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
    transform: translateX(4px);
}

html[dir="rtl"] .active-nav {
    transform: translateX(-4px);
}

.modal-container {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-box {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#spinner-overlay {
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.aspect-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.aspect-video-container iframe,
.aspect-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
}

/* Card animations */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Button animations */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Smooth gradients */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse animation for notifications */
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.pulse-notification {
    animation: pulse-ring 2s infinite;
}

/* Smooth fade-in for content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress bar styling */
.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 999px;
    height: 6px;
}

/* Rich-text editor toolbar tweaks */
.editor_atto_toolbar { gap: 8px; align-items: center; }
.editor_atto_toolbar .atto_group { display: flex; align-items: center; gap: 6px; }
.editor_atto_toolbar .toolbar-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.editor_atto_toolbar select { height: 34px; }
.editor_atto_toolbar .advanced { display: none; }
.editor_atto_toolbar .advanced.show { display: flex !important; }
.editor_atto_toolbar .toolbarbreak { flex-basis: 100%; height: 0; }
.editor_atto_toolbar .icon { width: 16px; height: 16px; }

.module-text-editor img, .module-text-editor iframe, .module-text-editor video { max-width: 100%; height: auto; }
