/* استایل‌های دژاگرف */
:root {
    --dg-primary: #d32f2f;
    --dg-success: #4caf50;
    --dg-warning: #ff9800;
    --dg-border: #ddd;
    --dg-bg-light: #f5f5f5;
}

.dg-order-form-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    font-family: 'Vazir', sans-serif;
}

/* Progress Bar */
.dg-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dg-step {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    background: #f5f5f5;
    margin: 0 5px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.dg-step.active {
    background: #ffd54f;
    color: #000;
}

/* Search Box */
.dg-search-box {
    position: relative;
    margin-bottom: 30px;
}

.dg-search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--dg-border);
    border-radius: 5px;
    font-size: 16px;
}

#dg-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--dg-border);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.dg-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dg-search-list li {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dg-search-list li:hover {
    background: #f0f0f0;
}

/* Order Item */
.dg-order-item {
    background: #fff;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 2px solid var(--dg-border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.dg-order-item h3 {
    color: var(--dg-primary);
    margin-top: 0;
    border-bottom: 2px solid #ffd54f;
    padding-bottom: 10px;
}

/* Form Row */
.dg-form-row {
    margin-bottom: 20px;
}

.dg-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.dg-form-row select,
.dg-form-row input,
.dg-form-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--dg-border);
    border-radius: 5px;
    font-size: 15px;
    transition: border 0.3s;
}

.dg-form-row select:focus,
.dg-form-row input:focus,
.dg-form-row textarea:focus {
    border-color: var(--dg-primary);
    outline: none;
}

.dg-form-row select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Description */
.dg-category-description,
.dg-sub-description {
    margin: 15px 0;
}

.dg-description {
    padding: 15px;
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
    border-radius: 5px;
    margin: 10px 0;
}

/* Unit Input */
.dg-unit-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dg-unit-input input {
    max-width: 150px;
}

.dg-unit-text {
    font-weight: bold;
    color: #666;
}

/* Price Display */
.dg-price-display {
    display: flex;
    justify-content: space-between;
    background: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    border: 2px solid #ffc107;
}

.dg-price-display strong {
    color: #333;
}

/* Order Actions */
.dg-order-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-start;
}

.dg-order-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.dg-btn-confirm {
    background: var(--dg-success);
    color: #fff;
}

.dg-btn-confirm:hover {
    background: #45a049;
}

.dg-btn-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.dg-btn-add {
    background: #2196f3;
    color: #fff;
}

.dg-btn-add:hover {
    background: #1976d2;
}

.dg-btn-delete {
    background: var(--dg-primary);
    color: #fff;
}

.dg-btn-delete:hover {
    background: #c62828;
}

/* Notes Section */
.dg-notes-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.dg-notes-section h3 {
    color: var(--dg-primary);
    margin-top: 0;
}

/* Form Actions */
.dg-form-actions {
    margin-top: 30px;
    text-align: center;
}

.dg-button {
    display: inline-block;
    padding: 15px 40px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    margin: 0 5px;
}

.dg-button:hover {
    background: #555;
}

.dg-button-primary {
    background: var(--dg-primary);
}

.dg-button-primary:hover {
    background: #c62828;
}

/* Summary Table */
.dg-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.dg-summary-table th,
.dg-summary-table td {
    padding: 15px;
    text-align: right;
    border: 1px solid var(--dg-border);
}

.dg-summary-table th {
    background: #ffd54f;
    font-weight: bold;
}

.dg-summary-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Discount Section */
.dg-discount-section {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.dg-discount-section input {
    padding: 12px;
    border: 2px solid var(--dg-border);
    border-radius: 5px;
    margin-left: 10px;
}

#dg-discount-message {
    margin-top: 10px;
}

#dg-discount-message .success {
    color: var(--dg-success);
    font-weight: bold;
}

#dg-discount-message .error {
    color: var(--dg-primary);
    font-weight: bold;
}

/* Total Section */
.dg-total-section {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--dg-border);
    margin: 20px 0;
}

.dg-total-section p {
    font-size: 18px;
    margin: 10px 0;
}

.dg-final-total {
    background: #ffd54f;
    padding: 15px;
    border-radius: 5px;
    font-size: 20px !important;
    font-weight: bold;
}

/* Expert Message */
.dg-expert-message {
    background: #e3f2fd;
    padding: 30px;
    border-radius: 10px;
    border-right: 5px solid #2196f3;
    margin: 20px 0;
    line-height: 1.8;
}

/* Success Box */
.dg-success-box {
    background: #e8f5e9;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--dg-success);
    text-align: center;
    margin: 20px 0;
}

.dg-success-box p {
    font-size: 18px;
    margin: 10px 0;
}

/* User Panel */
.dg-user-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
}

.dg-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.dg-tab {
    flex: 1;
    padding: 15px;
    background: #f5f5f5;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.dg-tab.active {
    background: var(--dg-primary);
    color: #fff;
}

.dg-tab-content {
    display: none;
}

.dg-tab-content.active {
    display: block;
}

.dg-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.dg-orders-table th,
.dg-orders-table td {
    padding: 15px;
    text-align: right;
    border: 1px solid var(--dg-border);
}

.dg-orders-table th {
    background: #ffd54f;
    font-weight: bold;
}

.dg-pay-button {
    padding: 10px 20px;
    background: var(--dg-success);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.dg-pay-button:hover {
    background: #45a049;
}

/* Not Logged In */
.dg-not-logged-in {
    text-align: center;
    padding: 50px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dg-not-logged-in .dg-main-text {
    margin-bottom: 30px;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .dg-progress-bar {
        flex-direction: column;
    }
    
    .dg-step {
        margin: 5px 0;
    }
    
    .dg-order-actions {
        flex-direction: column;
    }
    
    .dg-order-actions button {
        width: 100%;
    }
    
    .dg-price-display {
        flex-direction: column;
        gap: 10px;
    }
}

/* انیمیشن لودینگ */
.dg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.dg-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dg-spinner {
    display: inline-block;
    width: 80px;
    height: 80px;
}

.dg-spinner:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid var(--dg-primary);
    border-color: var(--dg-primary) transparent var(--dg-primary) transparent;
    animation: dg-spinner 1.2s linear infinite;
}

@keyframes dg-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* انیمیشن تب‌ها */
.dg-tab-transition {
    animation: dg-tab-fade 0.5s ease-in-out;
}

@keyframes dg-tab-fade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* سرچ باکس بهبود یافته */
.dg-category-search-box {
    position: relative;
    margin-bottom: 30px;
}

.dg-category-search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--dg-border);
    border-radius: 5px;
    font-size: 16px;
}

.dg-category-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--dg-border);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    display: none;
}

.dg-category-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dg-category-search-list li {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dg-category-search-list li:hover {
    background: #f0f0f0;
}

.dg-category-search-list .search-category-title {
    font-weight: bold;
    color: var(--dg-primary);
    border-bottom: 1px solid #eee;
    padding: 10px 15px;
    background: #f9f9f9;
}

/* وروودی روش پرداخت در ادمین */
.dg-payment-method {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.dg-payment-method h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.dg-payment-method select,
.dg-payment-method input {
    margin-bottom: 10px;
    display: block;
    width: 100%;
    padding: 8px;
}

.dg-payment-method label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* استایل برای تاریخ تحویل در پنل کاربری */
.dg-delivery-date {
    padding: 5px 10px;
    background: #fff3cd;
    border-radius: 3px;
    color: #856404;
    font-weight: bold;
}
/* اضافه کردن استایل بهبود یافته برای لودینگ */
.dg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.dg-loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.dg-spinner {
    display: inline-block;
    width: 80px;
    height: 80px;
    position: relative;
}

.dg-spinner:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid #d32f2f;
    border-color: #d32f2f transparent #d32f2f transparent;
    animation: dg-spinner 1.2s linear infinite;
}

@keyframes dg-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* بهبود استایل جستجو */
.dg-category-search-box,
.dg-search-box {
    position: relative;
    margin-bottom: 30px;
}

.dg-category-search-input,
#dg-service-search {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.dg-category-search-results,
#dg-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    display: none;
}

.dg-category-search-list,
.dg-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dg-category-search-list li,
.dg-search-list li {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dg-category-search-list li:hover,
.dg-search-list li:hover {
    background: #f0f0f0;
}

.search-category-title {
    font-weight: bold;
    color: #d32f2f;
    border-bottom: 1px solid #eee;
    padding: 10px 15px;
    background: #f9f9f9;
}

.no-results,
.error {
    padding: 15px;
    text-align: center;
}

.error {
    color: #d32f2f;
}

/* بهبود انتخاب‌گرها */
.dg-form-row select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border 0.3s;
    background-color: #fff;
}

.dg-form-row select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.dg-form-row select:focus {
    border-color: #d32f2f;
    outline: none;
}
/* Unified Search Box Styles */
.dg-unified-search-box {
    position: relative;
    margin-bottom: 30px;
}

.dg-unified-search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--dg-primary);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Vazir', sans-serif;
    transition: all 0.3s;
}

.dg-unified-search-box input:focus {
    outline: none;
    border-color: #ffd54f;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.2);
}

#dg-unified-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--dg-primary);
    border-top: none;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
}

.dg-unified-search-list {
    padding: 0;
    margin: 0;
}

.dg-search-result-item {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dg-search-result-item:hover {
    background: #fff9e6;
}

.dg-search-result-item:last-child {
    border-bottom: none;
}

.dg-result-main {
    margin-bottom: 8px;
    font-size: 15px;
}

.dg-result-main strong {
    color: var(--dg-primary);
    font-size: 16px;
}

.dg-result-type {
    color: #333;
    font-weight: 600;
}

.dg-result-levels {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

.dg-result-levels strong {
    color: #333;
    margin-left: 5px;
}

.dg-level-item {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.dg-level-item:hover {
    background: #ffd54f;
    border-color: var(--dg-primary);
    color: #000;
}

#dg-unified-search-results .no-results,
#dg-unified-search-results .error {
    padding: 20px;
    text-align: center;
    color: #999;
}

#dg-unified-search-results .error {
    color: var(--dg-primary);
}