/**
 * Mediadoria - Estilos adicionales de la aplicación
 */

/* =====================================================
   ÁREA DE CLIENTE - OCULTAR ELEMENTOS Y TIPOGRAFÍA
   ===================================================== */

/* Tipografía moderna sin serifa */
.woocommerce-account,
.woocommerce-account * {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.woocommerce-account h1,
.woocommerce-account h2,
.woocommerce-account h3,
.woocommerce-account h4,
.woocommerce-account .md-page-title {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif !important;
}

/* Cargar fuentes */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Ocultar título de página y header del tema padre */
.woocommerce-account .entry-title,
.woocommerce-account .page-title,
.woocommerce-account header.entry-header,
.woocommerce-account .elementor-page-title,
.woocommerce-account article > header,
.woocommerce-account .site-header .site-title,
.woocommerce-account .site-branding {
    display: none !important;
}

/* Ocultar "IA para mediadores" si es el site title */
.woocommerce-account .site-title,
.woocommerce-account .site-header a[rel="home"] {
    display: none !important;
}

/* Estilizar el header del sitio en área de cliente */
.woocommerce-account .site-header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    padding: 15px 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Crear cabecera personalizada vía CSS */
.woocommerce-account .site-header::before {
    content: "mediadorIA.es";
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: block;
    padding: 0 24px;
    max-width: 1850px;
    margin: 0 auto;
}

/* Mejorar contenedor principal */
.woocommerce-account .woocommerce {
    max-width: 1850px;
    margin: 0 auto;
    padding: 30px 24px;
    min-height: calc(100vh - 200px);
}

/* Pie de página en área de cliente - igual que la home */
.woocommerce-account .site-footer,
.woocommerce-account footer.site-footer {
    background: #0F172A !important;
    color: #FFFFFF !important;
    padding: 60px 0 0 !important;
    margin-top: 60px;
}

.woocommerce-account .site-footer > *,
.woocommerce-account footer.site-footer > * {
    display: none !important;
}

.woocommerce-account .site-footer::before,
.woocommerce-account footer.site-footer::before {
    content: "";
    display: block;
    max-width: 1850px;
    margin: 0 auto;
    padding: 0 24px 40px;
    border-bottom: 1px solid #334155;
}

.woocommerce-account .site-footer::after,
.woocommerce-account footer.site-footer::after {
    content: "© 2026 mediadorIA.es. Todos los derechos reservados.";
    display: block;
    text-align: center;
    font-size: 14px;
    color: #64748B;
    padding: 24px;
}

/* Eliminar "My account" título */
.woocommerce-account .woocommerce::before {
    display: none !important;
}

/* Ocultar h1/h2 que dicen "My account" */
.woocommerce-account .woocommerce > h1,
.woocommerce-account .woocommerce > h2,
.woocommerce-account article.page > .entry-content > h1 {
    display: none !important;
}

/* =====================================================
   MEJORAS GENERALES
   ===================================================== */

/* Links en tablas */
.md-table a {
    color: var(--md-primary);
    text-decoration: none;
}

.md-table a:hover {
    text-decoration: underline;
}

/* Iconos en botones */
.md-btn svg {
    width: 18px;
    height: 18px;
}

/* Inputs con iconos */
.md-input-icon {
    position: relative;
}

.md-input-icon input {
    padding-left: 40px;
}

.md-input-icon svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-gray-400);
}

/* =====================================================
   ANIMACIONES
   ===================================================== */

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.md-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.md-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* =====================================================
   TOOLTIPS
   ===================================================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--md-gray-900);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */

.md-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--md-gray-500);
}

.md-empty-state__icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.md-empty-state__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-gray-700);
    margin-bottom: 10px;
}

.md-empty-state__desc {
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* =====================================================
   SKELETON LOADING
   ===================================================== */

.md-skeleton {
    background: linear-gradient(90deg, var(--md-gray-200) 25%, var(--md-gray-100) 50%, var(--md-gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.md-skeleton--text {
    height: 16px;
    margin-bottom: 8px;
}

.md-skeleton--title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.md-skeleton--card {
    height: 100px;
    margin-bottom: 16px;
}

/* =====================================================
   RESPONSIVE AJUSTES
   ===================================================== */

@media (max-width: 768px) {
    .md-dashboard {
        padding: 15px;
    }
    
    .md-page-title {
        font-size: 1.5rem;
    }
    
    .md-modal__content {
        width: 95%;
        margin: 10px;
    }
    
    .md-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .md-btn--lg {
        width: 100%;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    .woocommerce-MyAccount-navigation,
    .md-btn,
    .md-modal,
    .md-filters {
        display: none !important;
    }
    
    .md-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .md-table {
        font-size: 12px;
    }
}

/* =====================================================
   MODAL - ESTILOS MEJORADOS
   ===================================================== */

.md-modal__header {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    padding: 20px 28px !important;
    border-bottom: 1px solid #6ee7b7;
    border-radius: 12px 12px 0 0;
}

.md-modal__title {
    color: #047857 !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    margin: 0 !important;
}

.md-modal__close {
    color: #047857 !important;
    font-size: 28px !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.md-modal__close:hover {
    opacity: 1;
}

.md-modal__body {
    padding: 28px !important;
}

.md-modal__footer {
    padding: 20px 28px !important;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* Reducir espacios entre campos del formulario */
.md-form__group {
    margin-bottom: 16px !important;
}

.md-form__row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px !important;
}

.md-form__row .md-form__group {
    flex: 1;
    margin-bottom: 0 !important;
}

.md-form__label {
    display: block;
    margin-bottom: 6px !important;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.md-form__input,
.md-form__select,
.md-form__textarea {
    width: 100%;
    padding: 10px 14px !important;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.md-form__input:focus,
.md-form__select:focus,
.md-form__textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Caja de IA - ajustar espaciado */
.md-ai-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.md-ai-box__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.md-ai-box__icon {
    font-size: 24px;
}

.md-ai-box__title {
    font-weight: 600;
    color: #047857;
    font-size: 16px;
}

/* HR separator */
.md-modal__body hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0 !important;
}

/* Modal content container */
.md-modal__content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* =====================================================
   BOTONES - ESTILOS GLOBALES
   ===================================================== */

/* Todos los botones centrados horizontal y verticalmente */
.md-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px;
}

/* Asegurar que los SVG dentro de botones se muestren */
.md-btn svg {
    display: inline-block !important;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Botones pequeños con solo icono */
.md-btn--sm svg {
    margin: 0;
}

/* Botones en grid de acciones rápidas */
.md-card__body .md-btn {
    padding: 12px 20px !important;
    min-height: 48px;
}

/* Asegurar que los filtros tengan labels inline */
.md-filters__group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-filters__label {
    white-space: nowrap;
    margin-bottom: 0 !important;
}
