/**
 * Bracelet Customizer - Public Styles
 * Frontend styles for the bracelet customizer
 */

/* Modal Styles */
.bracelet-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.bracelet-modal-content {
    position: relative;
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.bracelet-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #666;
    font-size: 28px;
    font-weight: bold;
    z-index: 1000;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.bracelet-modal-close:hover,
.bracelet-modal-close:focus {
    color: #000;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Customizer Container */
#bracelet-customizer-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#bracelet-customizer-root {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Customize Button */
.bracelet-customizer-button-wrapper {
    margin: 20px 0;
}

.bracelet-customize-btn {
    background: linear-gradient(135deg, #e5b546, #f16e63) !important;
    color: white !important;
    border: none !important;
    /*padding: 16px 32px !important;*/
    font-size: 16px !important;
    /*font-weight: 600 !important;*/
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3) !important;
    /*width: 100% !important;*/
    max-width: 300px !important;
}

.bracelet-customize-btn:hover {
    /*background: linear-gradient(135deg, #3730A3, #4F46E5) !important;*/
    background: #EBBF9A;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4) !important;
}

.bracelet-customize-btn:active {
    transform: translateY(0) !important;
}

/* Loading Spinner */
.bracelet-customizer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    font-size: 18px;
    color: #666;
}

.bracelet-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4F46E5;
    border-radius: 50%;
    animation: bracelet-spin 1s linear infinite;
    margin-right: 15px;
}

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

/* Product Page Integration */
.woocommerce .bracelet-customizer-button-wrapper {
    margin: 20px 0;
    clear: both;
}

.woocommerce .bracelet-customize-btn {
    display: block;
    margin: 0 auto;
}

/* Cart Item Customization Display */
.woocommerce-cart .bracelet-customization-data,
.woocommerce-checkout .bracelet-customization-data {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.bracelet-customization-data dt {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.bracelet-customization-data dd {
    margin: 0 0 10px 0;
    color: #666;
}

.bracelet-customization-preview {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 5px;
}

.bracelet-letter-preview {
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.bracelet-charm-preview {
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

/* Fix on flatsome theme */
button[id^="bc-"],
button[class^="bc-"] {
  all: revert;        /* resets everything to the user agent default */
  appearance: revert; /* ensure native button look */
  transition: none;   /* kill any transitions */
}

button[id^="bc-letter-color-"] {
	border-radius: 50% !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bracelet-modal-content {
        width: 98%;
        height: 95vh;
        margin: 1% auto;
    }
    
    .bracelet-modal-close {
        top: 15px;
        right: 15px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
    
    .bracelet-customize-btn {
        font-size: 14px !important;
        /*padding: 14px 24px !important;*/
    }
}

@media (max-width: 480px) {
    .bracelet-modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
	.bc-bracelet-preview-container {
		margin: 0 !important;
	}
	
	.bc-bracelet-preview-container + div {
		margin-top: 0 !important;
		font-size: 12px !important;
	}
}

/* Accessibility */
.bracelet-modal:focus-within .bracelet-modal-close {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

.bracelet-customize-btn:focus {
    outline: 2px solid #4F46E5 !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bracelet-modal {
        background-color: rgba(0, 0, 0, 0.95);
    }
    
    .bracelet-customize-btn {
        border: 1px solid #fff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bracelet-modal-close,
    .bracelet-customize-btn {
        transition: none !important;
    }
    
    .bracelet-loading-spinner {
        animation: none;
    }
    
    .bracelet-customize-btn:hover {
        transform: none !important;
    }
}