/* ==============================================
   ملف التصميم الخاص بصفحة إضافة مزاد جديد
   ============================================== */

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Cairo', sans-serif; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    min-height: 100vh; 
}

.form-card { 
    background: white; 
    border-radius: 20px; 
    padding: 30px; 
    max-width: 1000px; 
    margin: 0 auto; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
}

.preview-image { 
    max-width: 100px; 
    max-height: 100px; 
    margin: 5px; 
    border-radius: 8px; 
    object-fit: cover; 
}

.btn-publish { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
    color: white; 
    border: none; 
    padding: 12px 30px; 
    border-radius: 12px; 
    font-weight: bold; 
    width: 100%; 
}

.btn-publish:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 15px rgba(16,185,129,0.3); 
}

.btn-publish:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    transform: none; 
}

.btn-next, .btn-prev { 
    background: #667eea; 
    color: white; 
    border: none; 
    padding: 10px 25px; 
    border-radius: 12px; 
    font-weight: bold; 
    transition: 0.2s; 
}

.btn-next:hover, .btn-prev:hover { 
    background: #5a67d8; 
    transform: translateY(-1px); 
}

.dynamic-attribute { 
    background: #f8fafc; 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 15px; 
    border: 1px solid #e5e7eb; 
}

.conditional-attribute { 
    background: #e8f4f8; 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 15px; 
    border-right: 3px solid #667eea; 
}

.loading { 
    display: inline-block; 
    width: 20px; 
    height: 20px; 
    border: 2px solid #f3f3f3; 
    border-top: 2px solid #667eea; 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
}

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

.step-wizard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
}

.step-wizard::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    min-width: 60px;
}

.step-circle {
    width: 50px;
    height: 50px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    font-size: 18px;
    color: #6c757d;
    transition: all 0.3s;
}

.step-item.active .step-circle {
    background: #667eea;
    color: white;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.3);
}

.step-item.completed .step-circle {
    background: #10b981;
    color: white;
}

.step-item.completed .step-circle::after {
    content: '✓';
    font-size: 20px;
}

.step-item.completed .step-circle span {
    display: none;
}

.step-title {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
}

.step-item.active .step-title {
    color: #667eea;
    font-weight: 800;
}

.step-item.completed .step-title {
    color: #10b981;
}

.tab-pane { display: none; }
.tab-pane.active-tab { display: block; }

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.warning-message {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #b45309;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.warning-message.show { display: block; }

.info-message {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.info-message.show { display: block; }

.terms-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.terms-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.terms-checkbox label {
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
}

.terms-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-custom.show { display: flex; }

.modal-content-custom {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

.modal-header-custom {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close { 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: #9ca3af; 
}

.btn-accept { 
    background: #10b981; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 10px; 
    font-weight: bold; 
    width: 100%; 
    margin-top: 20px; 
}

.awarded-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.awarded-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

#map { 
    width: 100%; 
    height: 350px; 
    border-radius: 16px; 
    overflow: hidden; 
    border: 1px solid #dbe3ef; 
    margin-top: 14px; 
    z-index: 1; 
}

.coords-box { 
    margin-top: 10px; 
    background: #f8fafc; 
    border: 1px dashed #cbd5e1; 
    border-radius: 12px; 
    padding: 10px 12px; 
    font-size: 13px; 
    color: #475569; 
}

.address-actions { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    margin-top: 10px; 
}

.mini-btn { 
    height: 42px; 
    border: none; 
    border-radius: 10px; 
    padding: 0 14px; 
    background: #eff6ff; 
    color: #1d4ed8; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.2s ease; 
}

.suggestions-box { 
    position: absolute; 
    top: calc(100% + 8px); 
    right: 0; 
    left: 0; 
    z-index: 999; 
    background: #fff; 
    border: 1px solid #dbe3ef; 
    border-radius: 14px; 
    max-height: 260px; 
    overflow-y: auto; 
    display: none; 
}

.suggestion-item { 
    padding: 12px 14px; 
    border-bottom: 1px solid #eef2f7; 
    cursor: pointer; 
}

.address-wrap { 
    position: relative; 
}

.readonly-field { 
    background-color: #f8f9fa; 
    cursor: default; 
}

.datetime-picker-row { 
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 15px; 
}

.datetime-picker-row > div { 
    flex: 1; 
    min-width: 120px; 
}

/* أنماط اللوحات */
.plate-container {
    font-family: 'Cairo', 'Arial', sans-serif;
    direction: ltr;
}

.plate {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.plate:hover {
    transform: scale(1.02);
}

.plate-logo {
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plate-labels {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-top: 10px;
}

.plate-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    display: none;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.plate-preview.show {
    display: block;
}

.plate-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

#platePreviewContent .plate-container {
    max-width: 100% !important;
    width: 100% !important;
}

#platePreviewContent .plate-container > div {
    max-width: 100% !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .plate-preview {
        max-width: 280px;
    }
}

.step5-hidden {
    display: none !important;
}

.btn-capture {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    margin-top: 30px !important;  /* استخدام !important */
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.btn-capture:hover {
    background: #059669;
}

.btn-capture:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

/* تنسيق رسالة التحذير للكود */
.plate-code-warning {
    color: #dc2626;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.plate-code-warning.show {
    display: block;
}

/* تنسيق الحقل عند وجود خطأ */
.input-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.location-note {
    background: #e8f4f8;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #2c5282;
}