/* ملف CSS للواجهة الأمامية - الملاحظات الصوتية من WhatsApp */

/* المتغيرات العامة */
:root {
    --wvn-primary-color: #25d366;
    --wvn-secondary-color: #128c7e;
    --wvn-accent-color: #075e54;
    --wvn-text-color: #333;
    --wvn-light-bg: #f8f9fa;
    --wvn-border-color: #e1e5e9;
    --wvn-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --wvn-border-radius: 12px;
    --wvn-transition: all 0.3s ease;
}

/* إعادة تعيين الأساسيات */
.wvn-voice-player *,
.wvn-voice-notes-list *,
.wvn-categories-container * {
    box-sizing: border-box;
}

/* مشغل الملاحظة الصوتية الرئيسي */
.wvn-voice-player {
    background: #fff;
    border-radius: var(--wvn-border-radius);
    box-shadow: var(--wvn-shadow);
    margin: 20px 0;
    overflow: hidden;
    transition: var(--wvn-transition);
    border: 1px solid var(--wvn-border-color);
}

.wvn-voice-player:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* عنوان الملاحظة الصوتية */
.wvn-voice-title {
    padding: 20px 20px 10px;
    border-bottom: 1px solid var(--wvn-border-color);
    background: linear-gradient(135deg, var(--wvn-light-bg) 0%, #fff 100%);
}

.wvn-voice-title h3 {
    margin: 0;
    color: var(--wvn-text-color);
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.4;
}

/* حاوية المشغل */
.wvn-voice-player-container {
    padding: 20px;
}

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

.wvn-play-pause-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--wvn-primary-color) 0%, var(--wvn-secondary-color) 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--wvn-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.wvn-play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.wvn-play-pause-btn:active {
    transform: scale(0.95);
}

/* حاوية شريط التقدم */
.wvn-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wvn-progress-bar {
    height: 6px;
    background: var(--wvn-border-color);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.wvn-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wvn-primary-color) 0%, var(--wvn-secondary-color) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.wvn-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--wvn-primary-color);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* عرض الوقت */
.wvn-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
}

/* التحكم في الصوت */
.wvn-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.wvn-volume-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--wvn-transition);
}

.wvn-volume-btn:hover {
    background: var(--wvn-light-bg);
}

.wvn-volume-slider {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: var(--wvn-shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--wvn-transition);
}

.wvn-volume-control:hover .wvn-volume-slider {
    opacity: 1;
    visibility: visible;
}

.wvn-volume-range {
    width: 80px;
    height: 4px;
    background: var(--wvn-border-color);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.wvn-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--wvn-primary-color);
    border-radius: 50%;
    cursor: pointer;
}

/* البيانات الوصفية */
.wvn-voice-meta {
    padding: 15px 20px;
    background: var(--wvn-light-bg);
    border-top: 1px solid var(--wvn-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 0.9em;
}

.wvn-voice-date {
    color: #666;
}

.wvn-date-label {
    font-weight: 600;
    margin-left: 5px;
}

.wvn-voice-stats {
    color: var(--wvn-secondary-color);
    font-weight: 500;
}

.wvn-voice-description {
    width: 100%;
    margin-top: 10px;
    color: var(--wvn-text-color);
    line-height: 1.6;
}

/* إجراءات الملاحظة الصوتية */
.wvn-voice-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--wvn-border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.wvn-share-btn,
.wvn-download-btn {
    padding: 8px 16px;
    border: 1px solid var(--wvn-border-color);
    background: white;
    color: var(--wvn-text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: var(--wvn-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.wvn-share-btn:hover,
.wvn-download-btn:hover {
    background: var(--wvn-primary-color);
    color: white;
    border-color: var(--wvn-primary-color);
    transform: translateY(-1px);
}

/* قائمة الملاحظات الصوتية */
.wvn-voice-notes-list {
    margin: 20px 0;
}

.wvn-voice-note-item {
    margin-bottom: 25px;
}

.wvn-voice-note-item:last-child {
    margin-bottom: 0;
}

/* التصفح */
.wvn-pagination {
    margin: 30px 0;
    text-align: center;
}

.wvn-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: white;
    border: 1px solid var(--wvn-border-color);
    color: var(--wvn-text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--wvn-transition);
}

.wvn-pagination .page-numbers:hover,
.wvn-pagination .page-numbers.current {
    background: var(--wvn-primary-color);
    color: white;
    border-color: var(--wvn-primary-color);
}

/* أنماط المشغل المختلفة */

/* النمط العصري */
.wvn-style-modern {
    border-radius: 20px;
    background: linear-gradient(135deg, #fff 0%, var(--wvn-light-bg) 100%);
}

.wvn-style-modern .wvn-voice-title {
    background: transparent;
    border-bottom: none;
    padding-bottom: 0;
}

.wvn-style-modern .wvn-progress-bar {
    height: 8px;
    background: rgba(37, 211, 102, 0.1);
}

.wvn-style-modern .wvn-progress-fill {
    background: var(--wvn-primary-color);
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.3);
}

/* النمط البسيط */
.wvn-style-minimal {
    box-shadow: none;
    border: 2px solid var(--wvn-border-color);
    background: white;
}

.wvn-style-minimal .wvn-voice-title {
    background: transparent;
    border-bottom: 1px solid var(--wvn-border-color);
}

.wvn-style-minimal .wvn-play-pause-btn {
    background: var(--wvn-text-color);
    box-shadow: none;
}

.wvn-style-minimal .wvn-progress-fill {
    background: var(--wvn-text-color);
}

/* فئات الملاحظات الصوتية */
.wvn-categories-container {
    margin: 20px 0;
}

.wvn-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wvn-category-item {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: var(--wvn-border-radius);
    box-shadow: var(--wvn-shadow);
    transition: var(--wvn-transition);
}

.wvn-category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.wvn-category-link {
    text-decoration: none;
    color: var(--wvn-text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wvn-category-count {
    background: var(--wvn-primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: normal;
}

.wvn-category-description {
    margin: 10px 0 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

/* شبكة الفئات */
.wvn-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.wvn-category-card {
    background: white;
    border-radius: var(--wvn-border-radius);
    box-shadow: var(--wvn-shadow);
    overflow: hidden;
    transition: var(--wvn-transition);
}

.wvn-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.wvn-category-card .wvn-category-link {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: var(--wvn-text-color);
}

.wvn-category-name {
    margin: 0 0 10px;
    font-size: 1.1em;
    font-weight: 600;
}

/* المشغل المتقدم */
.wvn-advanced-player {
    background: white;
    border-radius: var(--wvn-border-radius);
    box-shadow: var(--wvn-shadow);
    overflow: hidden;
    margin: 20px 0;
}

.wvn-player-main {
    padding: 25px;
}

.wvn-current-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.wvn-track-info h4 {
    margin: 0 0 5px;
    font-size: 1.2em;
    color: var(--wvn-text-color);
}

.wvn-track-meta {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.wvn-track-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wvn-btn {
    background: none;
    border: 1px solid var(--wvn-border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--wvn-transition);
    font-size: 14px;
}

.wvn-btn:hover {
    background: var(--wvn-light-bg);
}

.wvn-btn.active {
    background: var(--wvn-primary-color);
    color: white;
    border-color: var(--wvn-primary-color);
}

.wvn-progress-section {
    margin: 20px 0;
}

.wvn-progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--wvn-primary-color);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--wvn-transition);
}

.wvn-progress-bar:hover .wvn-progress-handle {
    opacity: 1;
}

.wvn-time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.wvn-player-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.wvn-volume-slider {
    width: 100px;
    margin-right: 10px;
}

/* قائمة التشغيل */
.wvn-playlist {
    background: var(--wvn-light-bg);
    border-top: 1px solid var(--wvn-border-color);
}

.wvn-playlist-title {
    margin: 0;
    padding: 15px 25px;
    font-size: 1em;
    font-weight: 600;
    color: var(--wvn-text-color);
    border-bottom: 1px solid var(--wvn-border-color);
}

.wvn-playlist-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.wvn-playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 25px;
    border-bottom: 1px solid var(--wvn-border-color);
    cursor: pointer;
    transition: var(--wvn-transition);
}

.wvn-playlist-item:hover {
    background: white;
}

.wvn-playlist-item.active {
    background: rgba(37, 211, 102, 0.1);
    border-left: 3px solid var(--wvn-primary-color);
}

.wvn-item-info {
    flex: 1;
}

.wvn-item-title {
    display: block;
    font-weight: 500;
    color: var(--wvn-text-color);
    margin-bottom: 2px;
}

.wvn-item-duration {
    font-size: 0.8em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.wvn-item-play-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--wvn-transition);
}

.wvn-item-play-btn:hover {
    background: var(--wvn-primary-color);
    color: white;
}

/* رسائل الخطأ */
.wvn-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: var(--wvn-border-radius);
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

.wvn-no-notes,
.wvn-no-categories {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .wvn-voice-player {
        margin: 15px 0;
        border-radius: 8px;
    }
    
    .wvn-voice-title,
    .wvn-voice-player-container,
    .wvn-voice-meta,
    .wvn-voice-actions {
        padding: 15px;
    }
    
    .wvn-audio-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .wvn-progress-container {
        order: -1;
    }
    
    .wvn-current-track {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wvn-track-controls {
        align-self: center;
    }
    
    .wvn-player-options {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .wvn-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .wvn-voice-actions {
        justify-content: center;
    }
    
    .wvn-volume-control {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wvn-voice-title h3 {
        font-size: 1.1em;
    }
    
    .wvn-play-pause-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .wvn-voice-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wvn-voice-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .wvn-share-btn,
    .wvn-download-btn {
        text-align: center;
        justify-content: center;
    }
}

/* تحسينات إضافية للتفاعل */
.wvn-voice-player.playing .wvn-play-pause-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
    }
    100% {
        box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    }
}

.wvn-progress-bar {
    position: relative;
    overflow: visible;
}

.wvn-progress-bar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    cursor: pointer;
}

/* تحسين إمكانية الوصول */
.wvn-play-pause-btn:focus,
.wvn-btn:focus,
.wvn-share-btn:focus,
.wvn-download-btn:focus {
    outline: 2px solid var(--wvn-primary-color);
    outline-offset: 2px;
}

/* تحميل الملفات */
.wvn-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wvn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--wvn-border-color);
    border-top: 2px solid var(--wvn-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

