/**
 * تنسيقات النموذج الأمامي
 * 
 * @package Field_Visit_Reports
 */

/* ========== الحاوية الرئيسية ========== */
.fvr-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== رأس النموذج ========== */
.fvr-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.fvr-form-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.fvr-form-description {
    color: #7f8c8d;
    font-size: 15px;
    margin: 0;
}

/* ========== معلومات المستخدم ========== */
.fvr-user-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}

.fvr-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.fvr-user-badge .dashicons {
    font-size: 20px;
}

.fvr-login-notice {
    background: #e3f2fd;
    color: #1976d2;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    border-right: 4px solid #1976d2;
}

.fvr-login-notice .dashicons {
    vertical-align: middle;
    margin-left: 5px;
}

.fvr-login-notice a {
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed #1565c0;
}

.fvr-login-notice a:hover {
    color: #0d47a1;
    border-bottom-style: solid;
}

/* ========== أقسام النموذج ========== */
.fvr-form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #3498db;
}

.fvr-section-title {
    font-size: 20px;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.fvr-section-title .dashicons {
    color: #3498db;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* ========== مجموعات الحقول ========== */
.fvr-form-group {
    margin-bottom: 20px;
}

.fvr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fvr-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 15px;
}

.fvr-required {
    color: #e74c3c;
    margin-right: 3px;
}

/* ========== حقول الإدخال ========== */
.fvr-input,
.fvr-select,
.fvr-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.fvr-input:focus,
.fvr-select:focus,
.fvr-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.fvr-input.fvr-readonly {
    background: #ecf0f1;
    cursor: not-allowed;
    color: #7f8c8d;
    border-color: #bdc3c7;
}

.fvr-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.fvr-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

.fvr-input-file {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.fvr-input-file:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

/* ========== نص المساعدة ========== */
.fvr-help-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.fvr-help-text .dashicons {
    font-size: 16px;
    vertical-align: middle;
    margin-left: 3px;
}

/* ========== معاينة الصور ========== */
.fvr-image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.fvr-image-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.fvr-image-card:hover {
    transform: scale(1.05);
}

.fvr-image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.fvr-remove-image {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.fvr-remove-image:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

/* ========== التسجيل الصوتي ========== */
.fvr-audio-recorder {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.fvr-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fvr-recording-timer {
    font-size: 18px;
    font-weight: 600;
    color: #e74c3c;
    font-family: monospace;
    padding: 8px 16px;
    background: #fee;
    border-radius: 20px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.fvr-audio-preview {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 6px;
    border-right: 4px solid #4caf50;
}

.fvr-audio-preview audio {
    width: 100%;
    margin-bottom: 10px;
}

.fvr-audio-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2e7d32;
    font-weight: 600;
}

.fvr-audio-info .dashicons {
    color: #4caf50;
}

/* ========== الأزرار ========== */
.fvr-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.fvr-button .dashicons {
    font-size: 18px;
}

.fvr-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.fvr-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.fvr-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.fvr-button-secondary {
    background: #3498db;
    color: white;
}

.fvr-button-secondary:hover {
    background: #2980b9;
}

.fvr-button-record {
    background: #27ae60;
    color: white;
}

.fvr-button-record:hover {
    background: #229954;
}

.fvr-button-stop {
    background: #e74c3c;
    color: white;
}

.fvr-button-stop:hover {
    background: #c0392b;
}

.fvr-button-delete {
    background: #95a5a6;
    color: white;
}

.fvr-button-delete:hover {
    background: #7f8c8d;
}

/* ========== حالة الموقع ========== */
.fvr-location-status {
    display: inline-block;
    margin-right: 15px;
    font-size: 14px;
}

.fvr-location-status .fvr-success {
    color: #27ae60;
}

.fvr-location-status .fvr-error {
    color: #e74c3c;
}

.fvr-location-status .fvr-info {
    color: #3498db;
}

.fvr-location-status .dashicons {
    vertical-align: middle;
}

/* ========== الخريطة ========== */
.fvr-map {
    width: 100%;
    height: 300px;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========== رسائل النموذج ========== */
.fvr-form-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.fvr-form-message .dashicons {
    font-size: 20px;
}

.fvr-form-message.fvr-success {
    background: #d4edda;
    color: #155724;
    border-right: 4px solid #28a745;
}

.fvr-form-message.fvr-error {
    background: #f8d7da;
    color: #721c24;
    border-right: 4px solid #dc3545;
}

/* ========== أزرار الإرسال ========== */
.fvr-form-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* ========== أنيميشن التحميل ========== */
.fvr-spin {
    animation: fvr-spin-animation 1s linear infinite;
}

@keyframes fvr-spin-animation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== استجابة للهواتف ========== */
@media (max-width: 768px) {
    .fvr-form-container {
        padding: 20px;
        margin: 20px auto;
    }

    .fvr-form-header h2 {
        font-size: 24px;
    }

    .fvr-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .fvr-section-title {
        font-size: 18px;
    }

    .fvr-image-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .fvr-image-card img {
        height: 100px;
    }

    .fvr-button {
        width: 100%;
        justify-content: center;
    }

    .fvr-audio-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .fvr-audio-controls .fvr-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .fvr-form-container {
        padding: 15px;
    }

    .fvr-input,
    .fvr-select,
    .fvr-textarea {
        font-size: 14px;
        padding: 10px;
    }

    .fvr-map {
        height: 250px;
    }
}
