.custom-design-container {
    text-align: center;
    margin: 20px 0;
    width: 100%;
}

.custom-design-btn {
    background-color: #5E1492 !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    transition: all 0.3s !important;
    display: inline-block !important;
    margin: 0 auto !important;
    box-shadow: 0 4px 8px rgba(94, 20, 146, 0.3) !important;
    font-weight: bold !important;
}

.custom-design-btn:hover {
    background-color: #4a1078 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(94, 20, 146, 0.4) !important;
}

#mousepad-designer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.designer-container {
    background-color: white;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.designer-header {
    background-color: #5E1492;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.designer-header h2 {
    margin: 0;
    font-size: 20px;
    text-align: center;
    flex: 1;
}

.close-designer {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.close-designer:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.designer-body {
    padding: 20px;
}

.size-selector {
    margin-bottom: 15px;
    text-align: center;
}

.size-selector h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

#design-size {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-size: 14px;
    color: #333;
    width: 250px;
}

.designer-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.toolbar-btn {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn:hover {
    background-color: #5E1492;
    color: white;
}

.zoom-controls {
    display: flex;
    gap: 5px;
}

.zoom-btn {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: bold;
}

.zoom-btn:hover {
    background-color: #5E1492;
    color: white;
}

.icon-upload:before {
    content: "📁";
}

.icon-crop:before {
    content: "✂️";
}

.icon-reset:before {
    content: "🔄";
}

.icon-zoom-in:before,
.icon-zoom-out:before {
    font-weight: bold;
}

.designer-canvas-container {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    max-height: 60vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mousepad-canvas {
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: white;
    max-width: 100%;
    height: auto;
}

#crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crop-guide {
    position: absolute;
    border: 2px dashed #5E1492;
    background-color: rgba(94, 20, 146, 0.1);
    box-sizing: border-box;
}

.crop-instructions {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #5E1492;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
}

.crop-instructions p {
    margin: 5px 0;
    font-size: 12px;
}

.designer-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-btn {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.cancel-btn:hover {
    background-color: #e1e1e1;
}

.save-btn {
    background-color: #5E1492;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.save-btn:hover {
    background-color: #4a1078;
    transform: translateY(-2px);
}

.save-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.design-image-link {
    color: #5E1492 !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

/* تحسين التكيف مع الهواتف */
@media (max-width: 768px) {
    .designer-container {
        width: 95%;
        height: 90%;
        overflow-y: auto;
    }
    
    .designer-toolbar {
        flex-direction: column;
    }
    
    .toolbar-btn, .zoom-controls {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .designer-footer {
        flex-direction: column;
    }
    
    .cancel-btn, .save-btn {
        width: 100%;
        text-align: center;
    }
    
    .designer-canvas-container {
        max-height: 50vh;
        padding: 5px;
    }
    
    .custom-design-btn {
        padding: 15px 30px !important;
        font-size: 18px !important;
    }
    
    #design-size {
        width: 100%;
        max-width: 100%;
    }
    
    #mousepad-canvas {
        max-width: 95%;
        max-height: 40vh;
    }
}

/* دعم اللمس للأجهزة المحمولة */
@media (hover: none) and (pointer: coarse) {
    .custom-design-btn, .toolbar-btn, .cancel-btn, .save-btn, .zoom-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #mousepad-canvas {
        touch-action: manipulation;
    }
}