/* تنسيق عام */
:root {
    --primary-color: #49479d;
    --primary-hover: #3a3880;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --border-color: #ddd;
    --shadow-color: rgba(73, 71, 157, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f0f0f8;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* تنسيق النموذج */
.form-container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
}

/* تنسيق الشعار */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 200px;
    height: auto;
}

h1 {
    color: var(--primary-color);
    text-align: right;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-description {
    text-align: right;
    margin-bottom: 30px;
    color: #666;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: var(--error-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    transition: border 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(73, 71, 157, 0.2);
}

textarea {
    resize: vertical;
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

button:hover {
    background-color: var(--primary-hover);
}

.submit-group {
    text-align: center;
    margin-top: 30px;
}

/* تنسيق النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.success-icon {
    background-color: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
}

/* تنسيق متجاوب */
@media (max-width: 768px) {
    .form-container {
        padding: 20px;
    }

    input, select, textarea {
        padding: 10px 12px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 90%;
    }
}

/* تحسينات الوصولية */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* تنسيق حالة الخطأ */
input.error, select.error, textarea.error {
    border-color: var(--error-color);
}

/* تنسيق حالة النجاح */
input.success, select.success, textarea.success {
    border-color: var(--success-color);
}

/* تنسيق بطاقة العمل */
.business-card-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.business-card-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    overflow: hidden;
    position: relative;
}

.placeholder-text {
    color: #999;
    font-size: 16px;
}

#businessCardImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.secondary-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(73, 71, 157, 0.1);
}

.btn-icon {
    margin-left: 5px;
}

/* تنسيق الكاميرا */
.camera-modal-content {
    max-width: 600px;
}

.camera-container {
    width: 100%;
    height: 400px;
    margin: 20px 0;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

#cameraFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* تنسيق زر تبديل الكاميرا */
#switchCameraBtn {
    background-color: #3498db;
    color: white;
    border: none;
}

#switchCameraBtn:hover {
    background-color: #2980b9;
}

.primary-btn {
    background-color: var(--primary-color);
}

@media (max-width: 768px) {
    .business-card-actions {
        flex-direction: column;
    }

    .camera-container {
        height: 300px;
    }
}
