/**
 * Domain Product Periods Styles
 * Specific styles for domain product period selection
 */

.domain-product-form-container {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    position: relative;
}

.domain-product-form-container::before {
    content: "⏱️ Período de Registro";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #f9f9f9;
    padding: 0 10px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

/* Period Selection Styles */
.domain-period-selection {
    margin-bottom: 15px;
}

.domain-period-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.domain-period-selector {
    color: black;
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.domain-period-selector:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.domain-period-selector:hover {
    border-color: #2c5aa0;
}

/* Price Display Styles */
.domain-period-price-display {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
}

.domain-period-price-display.has-price {
    border-color: #27ae60;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.domain-period-price {
    font-size: 24px;
    font-weight: bold;
    color: #2c5aa0;
    display: inline-block;
}

.domain-period-price.loading {
    color: #999;
    position: relative;
}

.domain-period-price.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* Single Period Display */
.domain-single-period {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid #27ae60;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.period-text {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.period-price {
    font-size: 22px;
    font-weight: bold;
    color: #2c5aa0;
}

/* Additional Visual Elements */
.domain-price-details {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.domain-period-benefits {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4fd;
    border-left: 4px solid #2c5aa0;
    border-radius: 0 4px 4px 0;
}

.domain-period-benefits ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: #555;
}

.domain-period-benefits li {
    margin-bottom: 5px;
}

/* Animation Keyframes */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.domain-period-price-display {
    animation: fadeIn 0.5s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .domain-product-form-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .domain-period-selector {
        max-width: 100%;
        font-size: 16px; /* iOS zoom fix */
    }
    
    .domain-single-period {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .period-price {
        margin-top: 8px;
    }
    
    .domain-period-price {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .domain-product-form-container::before {
        font-size: 12px;
        padding: 0 8px;
    }
    
    .domain-period-selector {
        padding: 10px 12px;
    }
    
    .domain-period-price-display {
        padding: 12px;
    }
    
    .domain-period-price {
        font-size: 18px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .domain-product-form-container {
        background: #2a2a2a;
        border-color: #555;
        color: #fff;
    }
    
    .domain-product-form-container::before {
        background: #2a2a2a;
        color: #ccc;
    }
    
    .domain-period-selector {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .domain-period-price-display {
        background: #333;
        border-color: #555;
    }
    
    .domain-single-period {
        background: #333;
        border-color: #27ae60;
    }
}

/* Integration with WooCommerce styles */
.woocommerce .domain-product-form-container {
    font-family: inherit;
}

.woocommerce .domain-period-selector {
    font-family: inherit;
}

/* Accessibility Improvements */
.domain-period-selector:focus-visible {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.domain-period-price[aria-live="polite"] {
    /* Screen reader announcements */
}

/* Print Styles */
@media print {
    .domain-product-form-container {
        background: white !important;
        border: 1px solid #000 !important;
    }
    
    .domain-period-price.loading::after {
        display: none;
    }
}
