/* ملف CSS للمحادثات الصوتية */

/* الحاوي الرئيسي للصوت */
.wcv-audio-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
}

/* رأس الصوت */
.wcv-audio-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.wcv-audio-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.wcv-audio-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* قائمة المواضيع */
.wcv-topics-list {
    margin-bottom: 40px;
}

.wcv-topics-list h3 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.wcv-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.wcv-topic-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.wcv-topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.wcv-topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.wcv-topic-card:hover::before {
    transform: scaleX(1);
}

.wcv-topic-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.wcv-load-topic-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.wcv-load-topic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* قسم المشغل الصوتي */
.wcv-audio-player-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
}

.wcv-current-topic h3 {
    color: #667eea;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

/* أدوات التحكم الصوتي */
.wcv-audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.wcv-audio-controls button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.wcv-audio-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.wcv-audio-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#wcv-play-pause-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    font-size: 16px;
    padding: 15px 30px;
    min-width: 120px;
}

#wcv-play-pause-btn:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.wcv-auto-play-off {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

.wcv-auto-play-on {
    background: linear-gradient(135deg, #fd7e14 0%, #e63946 100%) !important;
}

/* معلومات الصوت */
.wcv-audio-info {
    margin-bottom: 30px;
}

#wcv-current-note-name {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-right: 4px solid #667eea;
}

/* شريط التقدم */
.wcv-progress-container {
    margin-bottom: 15px;
}

.wcv-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#wcv-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 10px;
}

.wcv-time-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-top: 8px;
}

/* قائمة التشغيل */
.wcv-playlist {
    border-top: 2px solid #f0f0f0;
    padding-top: 25px;
}

.wcv-playlist h4 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

#wcv-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.wcv-note-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wcv-note-item:hover {
    border-color: #667eea;
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.wcv-note-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.wcv-note-name {
    font-weight: 600;
    font-size: 16px;
}

.wcv-note-order {
    background: rgba(0,0,0,0.1);
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wcv-note-item.active .wcv-note-order {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* رسالة عدم وجود ملاحظات */
.wcv-no-audio {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 18px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
}

/* تأثيرات التحميل */
.wcv-audio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 18px;
    color: #667eea;
}

.wcv-audio-loading::before {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: wcv-audio-spin 1s linear infinite;
    margin-left: 15px;
}

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

/* تحسينات متجاوبة */
@media (max-width: 768px) {
    .wcv-audio-container {
        padding: 15px;
    }
    
    .wcv-audio-header h2 {
        font-size: 26px;
    }
    
    .wcv-topics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wcv-audio-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .wcv-audio-controls button {
        width: 100%;
        max-width: 200px;
    }
    
    .wcv-current-topic h3 {
        font-size: 22px;
    }
    
    #wcv-current-note-name {
        font-size: 18px;
    }
    
    .wcv-note-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wcv-note-order {
        align-self: flex-end;
    }
}

/* تحسينات إضافية */
.wcv-audio-container * {
    box-sizing: border-box;
}

/* تأثيرات الظهور */
.wcv-audio-player-section {
    animation: wcv-audio-fade-in 0.5s ease-out;
}

@keyframes wcv-audio-fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسين شريط التمرير */
#wcv-notes-list::-webkit-scrollbar {
    width: 8px;
}

#wcv-notes-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#wcv-notes-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

#wcv-notes-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* تحسين النصوص العربية */
.wcv-audio-container {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

/* تحسين التباين للوضع المظلم */
@media (prefers-color-scheme: dark) {
    .wcv-audio-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .wcv-audio-player-section,
    .wcv-topic-card,
    .wcv-note-item {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    #wcv-current-note-name {
        background: #333;
        color: #e0e0e0;
    }
    
    #wcv-notes-list {
        background: #333;
    }
}

/* تأثيرات صوتية بصرية */
.wcv-audio-visualizer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin: 10px 0;
    height: 40px;
}

.wcv-audio-bar {
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    animation: wcv-audio-wave 1.5s ease-in-out infinite;
}

.wcv-audio-bar:nth-child(2) { animation-delay: 0.1s; }
.wcv-audio-bar:nth-child(3) { animation-delay: 0.2s; }
.wcv-audio-bar:nth-child(4) { animation-delay: 0.3s; }
.wcv-audio-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wcv-audio-wave {
    0%, 100% { height: 10px; }
    50% { height: 30px; }
}

