/* Frontend CSS for WooCommerce Embroidery Plugin */

.wc-embroidery-customization {
    background: #f9f9f9;
    padding: 25px;
    margin: 30px 0;
    border: 2px solid #098398;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.embroidery-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #098398;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #098398;
    padding-bottom: 10px;
}

/* Preview Container */
.embroidery-preview-container {
    position: relative;
    text-align: center;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 25px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#embroidery-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.embroidery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    color: #098398;
    font-weight: 600;
}

/* Controls */
.embroidery-controls {
    margin-top: 20px;
}

.embroidery-field {
    margin-bottom: 20px;
}

.embroidery-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.char-counter {
    font-weight: normal;
    color: #666;
    font-size: 13px;
    margin-left: 5px;
}

.embroidery-input,
.embroidery-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.embroidery-input:focus,
.embroidery-select:focus {
    outline: none;
    border-color: #098398;
    box-shadow: 0 0 0 3px rgba(9, 131, 152, 0.1);
}

.embroidery-field .description {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Color Swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-swatch {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.color-swatch input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.swatch-color {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover .swatch-color {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-swatch input[type="radio"]:checked + .swatch-color {
    border-color: #098398;
    border-width: 4px;
    box-shadow: 0 0 0 3px rgba(9, 131, 152, 0.2);
}

/* Validation Message */
.embroidery-validation-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-weight: 600;
}

.embroidery-validation-message.error {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.embroidery-validation-message.success {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    color: #166534;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wc-embroidery-customization {
        padding: 20px 15px;
    }

    .embroidery-title {
        font-size: 20px;
    }

    .embroidery-preview-container {
        padding: 15px;
    }

    .color-swatches {
        gap: 10px;
    }

    .swatch-color {
        width: 40px;
        height: 40px;
    }
}

@media screen and (max-width: 480px) {
    .wc-embroidery-customization {
        padding: 15px 10px;
    }

    .embroidery-title {
        font-size: 18px;
    }

    .embroidery-input,
    .embroidery-select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .swatch-color {
        width: 35px;
        height: 35px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-embroidery-customization {
    animation: fadeIn 0.5s ease-out;
}
