/**
 * PrintInfoTech API - Product Configurator Styles
 */

/* Main Configurator Container */
.piapi-price-configurator {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    max-width: 400px;
}

.piapi-configurator-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #23282d;
}

/* Loading State */
.piapi-configurator-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.piapi-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: piapi-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Options Container */
.piapi-configurator-options {
    margin-bottom: 20px;
}

/* Individual Option Group */
.piapi-option-group {
    margin-bottom: 15px;
}

.piapi-option-group:last-child {
    margin-bottom: 0;
}

.piapi-option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 6px;
}

.piapi-option-label .piapi-info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #0073aa;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    margin-left: 5px;
    cursor: help;
    font-weight: bold;
}

.piapi-option-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.piapi-option-select:hover {
    border-color: #999;
}

.piapi-option-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.piapi-option-select:disabled {
    background-color: #f7f7f7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Price Display */
.piapi-price-display {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.piapi-price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.piapi-price-value {
    font-size: 28px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 10px;
}

.piapi-price-value.piapi-calculating {
    font-size: 16px;
    color: #999;
}

.piapi-ship-date {
    font-size: 13px;
    color: #23282d;
    margin-bottom: 10px;
    line-height: 1.5;
}

.piapi-ship-date strong {
    color: #0073aa;
}

.piapi-ship-date a {
    color: #0073aa;
    text-decoration: none;
}

.piapi-ship-date a:hover {
    text-decoration: underline;
}

.piapi-price-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    margin-top: 10px;
}

/* Action Buttons */
.piapi-configurator-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.piapi-configurator-actions button {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.piapi-upload-artwork {
    background: #d32f2f !important;
    color: #fff !important;
    border: none !important;
}

.piapi-upload-artwork:hover {
    background: #b71c1c !important;
}

.piapi-upload-artwork .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.piapi-calculate-shipping,
.piapi-markup-calculator {
    background: #fff !important;
    color: #23282d !important;
    border: 1px solid #ddd !important;
}

.piapi-calculate-shipping:hover,
.piapi-markup-calculator:hover {
    background: #f7f7f7 !important;
    border-color: #999 !important;
}

/* Error State */
.piapi-configurator-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    border-radius: 4px;
    padding: 15px;
    color: #dc2626;
    text-align: center;
}

.piapi-configurator-error p {
    margin: 0;
}

/* Sets Group Special Styling */
.piapi-option-group[data-group="sets"] {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .piapi-price-configurator {
        max-width: 100%;
        padding: 15px;
    }
    
    .piapi-price-value {
        font-size: 24px;
    }
    
    .piapi-option-select {
        padding: 12px;
    }
}

/* Tooltip Styles */
.piapi-tooltip {
    position: relative;
    display: inline-block;
}

.piapi-tooltip .piapi-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

.piapi-tooltip .piapi-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.piapi-tooltip:hover .piapi-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Shipping Modal */
.piapi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.piapi-modal {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.piapi-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.piapi-modal-close:hover {
    color: #333;
}

.piapi-modal h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.piapi-modal-form .form-group {
    margin-bottom: 15px;
}

.piapi-modal-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.piapi-modal-form input,
.piapi-modal-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.piapi-modal-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.piapi-modal-form button[type="submit"]:hover {
    background: #005a87;
}

.piapi-shipping-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.piapi-shipping-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.piapi-shipping-option:last-child {
    margin-bottom: 0;
}

.piapi-shipping-name {
    font-weight: 600;
}

.piapi-shipping-price {
    color: #0073aa;
    font-weight: 700;
}

/* Markup Calculator Modal */
.piapi-markup-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.piapi-markup-table th,
.piapi-markup-table td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.piapi-markup-table th {
    background: #f7f7f7;
    font-weight: 600;
}

.piapi-markup-table input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.piapi-markup-result {
    font-weight: 700;
    color: #0073aa;
}
