/* ═══════════════════════════════════════════════════════════════════
   FORM STYLES - النماذج
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--bg-soft);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-normal) var(--easing-smooth);
    background: var(--bg-main);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ❌ خطأ في الحقول */
.form-group input.error,
.form-group textarea.error {
    border-color: #dc2626;
    background-color: #fef2f2;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-group input.error:focus,
.form-group textarea.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* أنواع الطلبات */
.order-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.type-option {
    position: relative;
    cursor: pointer;
}

.type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-option span {
    display: block;
    padding: 14px 8px;
    text-align: center;
    border: 2px solid var(--bg-soft);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-normal) var(--easing-smooth);
    background: var(--bg-main);
    color: var(--text-secondary);
}

.type-option:hover span {
    border-color: var(--primary-light);
    background: var(--primary-soft);
}

.type-option input:checked+span {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   SUCCESS MODAL - نافذة النجاح
   ═══════════════════════════════════════════════════════════════════ */

.success-icon {
    font-size: 3.5rem;
    color: var(--success);
    margin-bottom: 16px;
    animation: successPop 0.5s var(--easing-bounce);
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.success-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.success-content #orderId {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.15rem;
}

.close-success {
    margin-top: 20px;
    padding: 14px 36px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal) var(--easing-smooth);
}

.close-success:hover {
    background: var(--text-secondary);
    transform: scale(1.03);
}


/* ═══════════════════════════════════════════════════════════════════
   واجهة الملاحظات الصوتية
   ═══════════════════════════════════════════════════════════════════ */

/* حاوية الملاحظات الموحدة */
.unified-notes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notes-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.notes-input-row textarea {
    flex: 1;
}

/* زر المايك المدمج */
.inline-mic-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--primary-glow);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.inline-mic-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px var(--primary-glow);
}

.inline-mic-btn:active {
    transform: scale(0.95);
}

.inline-mic-btn i {
    font-size: 1.1rem;
}

/* حالة التسجيل: أحمر نابض */
.inline-mic-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* حالة التسجيل المؤكد: أخضر */
.inline-mic-btn.has-recording {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    pointer-events: none;
}

/* منطقة التسجيل - تنزلق تحت الـ textarea */
.voice-recording-area {
    display: none;
}

.voice-recording-area.active {
    display: block;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voice-state {
    display: none;
    width: 100%;
}

.voice-state.active {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}


/* حالة التسجيل النشطة */
#voiceRecording.voice-state.active {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

/* حالة التسجيل المكتمل */
#voiceRecorded.voice-state.active {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

/* مؤشر التسجيل */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-weight: 600;
    font-size: 1rem;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* عداد الوقت */
.recording-timer {
    font-size: 1.75rem;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* زر الإيقاف */
.voice-stop-btn {
    padding: 10px 24px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
}

.voice-stop-btn:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.4);
}

.voice-stop-btn:active {
    transform: translateY(0);
}

.voice-stop-btn i {
    font-size: 1.2rem;
}

/* مؤشر مستوى الصوت (Audio Level Meter) */
.audio-level-meter {
    width: 100%;
    max-width: 280px;
    margin: 16px auto;
    padding: 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.audio-level-text {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #64748b;
    transition: color 0.3s;
}

.audio-bars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    height: 50px;
}

.audio-bar {
    flex: 1;
    max-width: 18px;
    height: 10%;
    background: #e2e8f0;
    border-radius: 4px 4px 0 0;
    transition: all 0.1s ease-out;
}

.audio-bar.active {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    height: 100%;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* تأثير تموج للأعمدة النشطة */
.audio-bar.active:nth-child(1) {
    height: 40%;
}

.audio-bar.active:nth-child(2) {
    height: 60%;
}

.audio-bar.active:nth-child(3) {
    height: 80%;
}

.audio-bar.active:nth-child(4) {
    height: 100%;
}

.audio-bar.active:nth-child(5) {
    height: 90%;
}

.audio-bar.active:nth-child(6) {
    height: 100%;
}

.audio-bar.active:nth-child(7) {
    height: 80%;
}

.audio-bar.active:nth-child(8) {
    height: 60%;
}

.audio-bar.active:nth-child(9) {
    height: 70%;
}

.audio-bar.active:nth-child(10) {
    height: 50%;
}

/* معاينة التسجيل */
.voice-preview {
    width: 100%;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.voice-preview audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
}

.voice-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.voice-actions button {
    padding: 9px 18px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: #f5f5f4;
    color: #78716c;
    border-color: #e7e5e4;
}

.btn-secondary:hover {
    background: #e7e5e4;
    color: #57534e;
    border-color: #d6d3d1;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #f59e0b;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-color: #fbbf24;
}

/* Responsive */
@media (max-width: 480px) {
    .voice-record-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .voice-record-btn i {
        font-size: 1rem;
    }

    .voice-hint {
        font-size: 0.8rem;
    }

    .recording-timer {
        font-size: 1.5rem;
    }

    .audio-level-meter {
        padding: 10px;
    }

    .voice-actions button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .voice-stop-btn {
        padding: 9px 20px;
        font-size: 0.85rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   🎧 Voice Preview Styles
   ═══════════════════════════════════════════════════════════════════ */

.audio-preview-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-soft);
    border-radius: 16px;
    margin-bottom: 16px;
}

.play-preview-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.play-preview-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

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

.preview-progress-container {
    flex: 1;
    height: 8px;
    background: #e7e5e4;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.preview-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    transition: width 0.1s linear;
}

.preview-time {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    font-family: 'Tajawal', sans-serif;
}

.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.preview-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-confirmed {
    text-align: center;
    padding: 24px;
    background: #d1fae5;
    border-radius: 16px;
    margin-bottom: 16px;
}

.voice-confirmed i {
    font-size: 48px;
    color: #059669;
    margin-bottom: 12px;
}

.voice-confirmed p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #047857;
}

.voice-confirmed small {
    color: #059669;
    font-size: 14px;
}

.btn-danger-outline {
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.btn-danger-outline:hover {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
}

/* Recording warning animation */
@keyframes warningPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.recording-warning {
    animation: warningPulse 1s ease-in-out infinite;
}

