/**
 * WooCommerce Matrículas Personalizadas - Styles
 */

.wc-matriculas-custom-fields {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.wc-matriculas-field-group {
    margin-bottom: 20px;
}

.wc-matriculas-field-group:last-child {
    margin-bottom: 0;
}

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

.wc-matriculas-field-group label .required {
    color: #e74c3c;
    font-weight: bold;
}

.wc-matriculas-field-group input[type="text"],
.wc-matriculas-field-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wc-matriculas-field-group input[type="text"]:focus,
.wc-matriculas-field-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wc-matriculas-field-group input[type="text"].wc-matriculas-invalid,
.wc-matriculas-field-group select.wc-matriculas-invalid {
    border-color: #e74c3c;
}

.wc-matriculas-field-group input[type="text"].wc-matriculas-invalid:focus,
.wc-matriculas-field-group select.wc-matriculas-invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.wc-matriculas-help-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.wc-matriculas-price-display {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border: 2px solid #27ae60;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.wc-matriculas-price-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-right: 10px;
}

.wc-matriculas-price-value {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
}

/* Checkout upload field styles */
.wc-matriculas-upload-section {
    margin: 30px 0;
    padding: 25px;
    background-color: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.wc-matriculas-upload-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.wc-matriculas-instructions {
    margin: 0 0 20px 0;
    padding: 15px;
    background-color: #fff;
    border-left: 4px solid #3498db;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.wc-matriculas-upload-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.wc-matriculas-upload-field input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.wc-matriculas-upload-field input[type="file"]:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.wc-matriculas-upload-field input[type="file"]:focus {
    outline: none;
    border-color: #3498db;
    background-color: #e3f2fd;
}

.wc-matriculas-upload-help {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Responsive styles */
@media (max-width: 768px) {
    .wc-matriculas-custom-fields {
        padding: 15px;
    }
    
    .wc-matriculas-field-group input[type="text"],
    .wc-matriculas-field-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .wc-matriculas-price-value {
        font-size: 20px;
    }
    
    .wc-matriculas-upload-section {
        padding: 15px;
    }
}

/* Animation for price display */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-matriculas-price-display {
    animation: slideDown 0.3s ease;
}

/* ============================= */
/* Preview - Matrícula Portuguesa Europeia */
/* ============================= */
.wc-matriculas-preview-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

.wc-matriculas-preview {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border-radius: 4px;
    border: 3px solid #000;
    background: #ffffff;
    font-family: 'Arial Narrow', 'Arial', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 3px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(0,0,0,0.1);
    min-height: 60px;
}

.wc-matriculas-preview-left-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 60px;
    padding: 0;
    background: transparent;
    border-right: 1px solid rgba(0,0,0,0.2);
    overflow: hidden;
}

.wc-matriculas-preview-left-band img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wc-matriculas-preview-right-band {
    display: none; /* Escondida por padrão */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 60px;
    padding: 0;
    background: transparent;
    border-left: 1px solid rgba(0,0,0,0.2);
    overflow: hidden;
}

.wc-matriculas-preview-right-band img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wc-matriculas-preview-text {
    flex: 1;
    padding: 0 12px;
    font-size: 50px;
    color: #000;
    text-align: center;
    min-width: 200px;
    font-weight: 900;
    text-transform: uppercase;
}

/* Design: anterior a 03/2020 - Fundo amarelo (matrículas antigas) */
#wc_matriculas_fields.design-anterior .wc-matriculas-preview {
    border-color: #000;
}

#wc_matriculas_fields.design-anterior .wc-matriculas-preview-text {
    color: #000;
}

/* Mostrar banda direita apenas nas matrículas anteriores a 03/2020 */
#wc_matriculas_fields.design-anterior .wc-matriculas-preview-right-band {
    display: flex;
}

/* Design: posterior a 03/2020 - Fundo branco (matrículas atuais) */
#wc_matriculas_fields.design-posterior .wc-matriculas-preview {
    background: #ffffff;
    border-color: #000;
}

#wc_matriculas_fields.design-posterior .wc-matriculas-preview-text {
    color: #000;
}

/* Design: clássicos - Estilo preto vintage (sem banda esquerda) */
#wc_matriculas_fields.design-classicos .wc-matriculas-preview {
    background: #1a1a1a;
    border-color: #888;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.1);
}

#wc_matriculas_fields.design-classicos .wc-matriculas-preview-text {
    color: #fff;
    text-shadow: 0 0 2px rgba(255,255,255,0.3);
}

/* Esconder banda esquerda nas matrículas clássicas */
#wc_matriculas_fields.design-classicos .wc-matriculas-preview-left-band {
    display: none;
}

/* Responsivo */
@media (max-width: 480px) {
    .wc-matriculas-preview {
        min-height: 50px;
    }
    
    .wc-matriculas-preview-left-band {
        width: 32px;
        min-height: 50px;
        font-size: 8px;
    }
    
    .wc-matriculas-preview-left-band::before {
        font-size: 12px;
    }
    
    .wc-matriculas-preview-left-band::after {
        font-size: 14px;
    }
    
    .wc-matriculas-preview-text {
        font-size: 24px;
        padding: 0 12px;
        min-width: 160px;
    }
}

/* Admin order page styles */
.wc-matriculas-document-info {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

.wc-matriculas-document-info h3 {
    margin-top: 0;
    color: #23282d;
}

.wc-matriculas-document-info p {
    margin: 10px 0;
}

.wc-matriculas-document-info .button {
    margin-right: 10px;
}

.wc-matriculas-error {
    color: #dc3232;
    font-weight: bold;
}

/* Accessibility improvements */
.wc-matriculas-field-group input[type="text"]:focus,
.wc-matriculas-field-group select:focus,
.wc-matriculas-upload-field input[type="file"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .wc-matriculas-custom-fields,
    .wc-matriculas-upload-section {
        border: 1px solid #000;
        background-color: #fff !important;
    }
}
