/**
 * Estilos do frontend
 * Alce | Guia de Tamanhos
 */

/* Container principal da aba */
.alce-size-guide-content {
    padding: 20px 0;
    font-family: inherit;
    line-height: 1.6;
    color: #333;
}

/* Layout de duas colunas para desktop */
.alce-size-guide-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Coluna da imagem (esquerda) */
.alce-size-guide-image-column {
    flex: 0 0 45%;
    max-width: 45%;
}

/* Coluna dos textos (direita) */
.alce-size-guide-text-column {
    flex: 1;
    min-width: 0;
}

/* Imagem do guia */
.alce-size-guide-image {
    text-align: center;
    margin-bottom: 0;
}

.alce-guide-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: zoom-in;
}

.alce-guide-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Seções de conteúdo */
.alce-size-guide-description,
.alce-size-guide-observation {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
    position: relative;
}

.alce-size-guide-observation {
    border-left-color: #ff6b35;
    background: #fff8f5;
}

.alce-size-guide-description h4,
.alce-size-guide-observation h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.alce-size-guide-description h4:before {
    content: "📏";
    margin-right: 8px;
    font-size: 18px;
}

.alce-size-guide-observation h4:before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 18px;
}

.description-content,
.observation-content {
    color: #555;
    line-height: 1.6;
}

.description-content p,
.observation-content p {
    margin: 0 0 10px 0;
}

.description-content p:last-child,
.observation-content p:last-child {
    margin-bottom: 0;
}

/* Footer da aba */
.alce-size-guide-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.alce-help-text {
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 4px;
    border: 1px solid #e1f1ff;
}

/* Modal para zoom da imagem */
.alce-image-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    cursor: zoom-out;
    animation: alce-modal-fade-in 0.3s ease;
}

.alce-image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: alce-image-zoom-in 0.3s ease;
}

.alce-image-modal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000000;
    transition: opacity 0.2s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.alce-image-modal .close:hover {
    opacity: 0.7;
}

/* Animações */
@keyframes alce-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes alce-image-zoom-in {
    from { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Integração com temas WooCommerce */
.woocommerce-tabs .alce-size-guide-content {
    padding: 20px 0;
}

.woocommerce-tabs .panel.woocommerce-Tabs-panel--size_guide {
    padding: 20px;
}

/* Responsivo */
@media (max-width: 768px) {
    .alce-size-guide-content {
        padding: 15px 0;
    }
    
    /* Layout mobile: imagem acima, textos abaixo */
    .alce-size-guide-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .alce-size-guide-image-column,
    .alce-size-guide-text-column {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    
    .alce-size-guide-image {
        margin-bottom: 20px;
    }
    
    .alce-size-guide-description,
    .alce-size-guide-observation {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .alce-size-guide-description h4,
    .alce-size-guide-observation h4 {
        font-size: 14px;
    }
    
    .alce-size-guide-description h4:before,
    .alce-size-guide-observation h4:before {
        font-size: 16px;
        margin-right: 6px;
    }
    
    .alce-image-modal img {
        max-width: 95%;
        max-height: 95%;
    }
    
    .alce-image-modal .close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .alce-help-text {
        font-size: 14px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .alce-size-guide-content {
        padding: 10px 0;
    }
    
    .alce-size-guide-description,
    .alce-size-guide-observation {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .alce-size-guide-description h4,
    .alce-size-guide-observation h4 {
        font-size: 13px;
    }
    
    .alce-image-modal .close {
        top: 5px;
        right: 10px;
        font-size: 25px;
    }
}

/* Compatibilidade com temas populares */

/* Storefront */
.storefront .alce-size-guide-content {
    font-family: inherit;
}

/* Astra */
.astra-theme .alce-size-guide-content {
    font-family: inherit;
}

/* OceanWP */
.oceanwp-theme .alce-size-guide-content {
    font-family: inherit;
}

/* GeneratePress */
.generate-theme .alce-size-guide-content {
    font-family: inherit;
}

/* Customizações para temas escuros */
@media (prefers-color-scheme: dark) {
    .alce-size-guide-description,
    .alce-size-guide-observation {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .alce-size-guide-description h4,
    .alce-size-guide-observation h4 {
        color: #fff;
    }
    
    .description-content,
    .observation-content {
        color: #ccc;
    }
    
    .alce-help-text {
        background: #1a1a1a;
        border-color: #333;
        color: #ccc;
    }
    
    .alce-guide-image {
        border-color: #444;
    }
}

/* Estados de carregamento */
.alce-size-guide-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.alce-size-guide-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: alce-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Melhorias de acessibilidade */
.alce-guide-image:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.alce-image-modal .close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .alce-image-modal {
        display: none !important;
    }
    
    .alce-guide-image {
        cursor: default;
        transform: none !important;
    }
    
    .alce-guide-image:hover {
        transform: none !important;
    }
}