/* assets/css/frontend.css */

/* الحاوية الرئيسية */
.dcd-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* تنسيق الخطوات */
.dcd-step {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.dcd-step h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    text-align: center;
}

/* شبكة التصاميم */
.dcd-designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* عنصر التصميم */
.dcd-design-item {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dcd-design-item:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
}

.dcd-design-item.selected {
    border-color: #0073aa;
    background-color: #f0f8ff;
}

.dcd-design-item img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    margin-bottom: 10px;
}

.dcd-design-item h4 {
    margin: 10px 0;
    color: #333;
}

.dcd-select-design {
    width: 100%;
    margin-top: 10px;
}

/* نموذج إدخال كود الخصم */
.dcd-form {
    max-width: 600px;
    margin: 0 auto;
}

.dcd-selected-design-preview {
    text-align: center;
    margin-bottom: 30px;
}

.dcd-selected-design-preview img {
    max-width: 200px;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.dcd-input-group {
    margin-bottom: 20px;
}

.dcd-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

#dcd-discount-code {
    width: 100%;
    padding: 12px 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
    text-transform: uppercase;
    box-sizing: border-box;
}

#dcd-discount-code:focus {
    outline: none;
    border-color: #0073aa;
}

.dcd-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.dcd-buttons button {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
}

/* معاينة التصميم النهائي */
.dcd-final-preview {
    text-align: center;
}

.dcd-loading {
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dcd-preview-container img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 30px;
}

.dcd-action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dcd-action-buttons button,
.dcd-action-buttons a {
    padding: 12px 25px;
    font-size: 16px;
    text-decoration: none;
}

/* نافذة العرض المنبثقة */
.dcd-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.dcd-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.dcd-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.dcd-close:hover,
.dcd-close:focus {
    color: #bbb;
}

/* التوافق مع Elementor */
.elementor-widget-container .dcd-wrapper {
    width: 100%;
}

/* أزرار WordPress الافتراضية */
.dcd-wrapper .button {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    cursor: pointer;
    border: 1px solid #0073aa;
    -webkit-appearance: none;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    background: #f7f7f7;
    color: #0073aa;
}

.dcd-wrapper .button:hover {
    background: #fafafa;
    border-color: #0073aa;
    color: #0073aa;
}

.dcd-wrapper .button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
}

.dcd-wrapper .button-primary:hover {
    background: #006ba1;
    border-color: #006ba1;
    color: #fff;
}

/* استجابة الشاشات الصغيرة */
@media screen and (max-width: 768px) {
    .dcd-wrapper {
        padding: 10px;
    }
    
    .dcd-step {
        padding: 20px;
    }
    
    .dcd-designs-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .dcd-buttons {
        flex-direction: column;
    }
    
    .dcd-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dcd-action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .dcd-action-buttons button,
    .dcd-action-buttons a {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dcd-close {
        right: 15px;
        top: 10px;
        font-size: 30px;
    }
}

/* استجابة الشاشات الصغيرة جداً */
@media screen and (max-width: 480px) {
    .dcd-designs-grid {
        grid-template-columns: 1fr;
    }
    
    .dcd-step h3 {
        font-size: 20px;
    }
    
    #dcd-discount-code {
        font-size: 16px;
        padding: 10px;
    }
}