/**
 * Podcast Management System - Custom Styles
 * RTL (Right-to-Left) support for Hebrew
 * Bootstrap-compatible responsive design
 */

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

[dir="rtl"] .navbar-nav {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* ============================================
   Card Hover Effects
   ============================================ */

.hover-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   Media Player Styling
   ============================================ */

audio, video {
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

audio:focus, video:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ============================================
   Recording Items
   ============================================ */

.recording-item {
    transition: border-color 0.2s ease-in-out;
}

.recording-item:hover {
    border-color: #0d6efd;
}

/* ============================================
   Admin Panel Specific
   ============================================ */

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    margin: 0 0.25rem;
}

.category-cover-preview {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* ============================================
   File Upload Areas
   ============================================ */

.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.file-upload-area.drag-over {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

/* ============================================
   Loading States
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
}

/* ============================================
   Toast Notifications (Custom)
   ============================================ */

.toast-container-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

[dir="rtl"] .toast-container-custom {
    right: auto;
    left: 20px;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #6c757d;
}

.empty-state svg, .empty-state img {
    max-width: 200px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ============================================
   Scan Results
   ============================================ */

.scan-results-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 0.25rem;
}

.scan-results-item.found {
    background-color: #e7f1ff;
}

.scan-results-item.registered {
    background-color: #d1e7dd;
}

.scan-results-item.skipped {
    background-color: #fff3cd;
}

.scan-results-item.error {
    background-color: #f8d7da;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .table-actions .btn {
        display: block;
        width: 100%;
        margin: 0.25rem 0;
    }

    .navbar-text {
        display: block;
        margin: 0.5rem 0;
    }

    audio, video {
        margin-top: 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .navbar, .nav-tabs, .btn, .footer {
        display: none !important;
    }

    audio, video {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

/* ============================================
   Accessibility
   ============================================ */

.sr-only-focusable:not(:focus):not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}
