/**
 * Estilos para el área pública del plugin PRO.Farmacias
 *
 * @package    Pro_Farmacias
 * @subpackage Pro_Farmacias/public/css
 */

/* Variables CSS */
:root {
    --pf-primary: #2E7D32;
    --pf-secondary: #1565C0;
    --pf-accent: #FF6B35;
    --pf-light: #F5F5F5;
    --pf-dark: #212121;
    --pf-text: #333333;
    --pf-text-light: #666666;
    --pf-border: #E0E0E0;
    --pf-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --pf-shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --pf-radius: 12px;
    --pf-transition: all 0.3s ease;
}

/* Contenedor principal */
.pro-farmacias-wrapper {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.pro-farmacias-wrapper[data-formato="cards"] {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.pro-farmacias-wrapper[data-formato="lista"] {
    grid-template-columns: 1fr;
}

/* Widget principal de farmacia */
.pf-widget-guardia {
    display: flex;
    background: #ffffff;
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    padding: 20px;
    transition: var(--pf-transition);
    border: 1px solid var(--pf-border);
    overflow: hidden;
}

.pf-widget-guardia:hover {
    transform: translateY(-2px);
    box-shadow: var(--pf-shadow-hover);
    border-color: var(--pf-primary);
}

/* Imagen de la farmacia */
.pf-widget-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    margin-right: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--pf-light);
}

.pf-widget-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pf-widget-guardia:hover .pf-widget-image img {
    transform: scale(1.05);
}

.pf-widget-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pf-primary) 0%, var(--pf-secondary) 100%);
}

.pf-placeholder-icon .dashicons {
    font-size: 48px;
    color: #ffffff;
    opacity: 0.8;
}

/* Contenido del widget */
.pf-widget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pf-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pf-widget-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--pf-dark);
    line-height: 1.3;
}

.pf-widget-badge {
    background-color: var(--pf-accent);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

/* Información de la farmacia */
.pf-widget-info {
    flex: 1;
    color: var(--pf-text-light);
    font-size: 14px;
    line-height: 1.6;
}

.pf-widget-info p {
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
}

.pf-widget-info .dashicons {
    color: var(--pf-primary);
    margin-right: 8px;
    margin-top: 2px;
    flex-shrink: 0;
}

.pf-widget-titular {
    color: var(--pf-text);
}

.pf-widget-address small {
    color: var(--pf-primary);
    font-weight: 600;
}

.pf-widget-city {
    color: var(--pf-primary);
    font-weight: 600;
    font-size: 13px;
    opacity: 0.9;
}

/* Teléfonos */
.pf-widget-phones {
    margin: 12px 0;
}

.pf-widget-phones a {
    color: var(--pf-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pf-widget-phones a:hover {
    color: var(--pf-primary);
    text-decoration: underline;
}

.pf-widget-phone-mobile small {
    color: var(--pf-text-light);
    font-weight: normal;
}

/* Horario especial */
.pf-widget-schedule {
    background-color: var(--pf-light);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--pf-accent);
    font-style: italic;
}

/* Información del turno */
.pf-widget-turno-info {
    color: var(--pf-primary);
    font-weight: 600;
    background-color: rgba(46, 125, 50, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Botones de acción */
.pf-widget-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pf-border);
}

.pf-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--pf-transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.pf-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pf-button-primary {
    background-color: var(--pf-primary);
    color: #ffffff;
    border-color: var(--pf-primary);
}

.pf-button-primary:hover {
    background-color: #236a26;
    border-color: #236a26;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3);
}

.pf-button-secondary {
    background-color: #ffffff;
    color: var(--pf-secondary);
    border-color: var(--pf-secondary);
}

.pf-button-secondary:hover {
    background-color: var(--pf-secondary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(21, 101, 192, 0.3);
}

/* Vista de lista */
.pf-list-item {
    background: #ffffff;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    padding: 16px;
    transition: var(--pf-transition);
}

.pf-list-item:hover {
    border-color: var(--pf-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pf-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pf-list-item-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--pf-dark);
}

.pf-badge-mini {
    background-color: var(--pf-light);
    color: var(--pf-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.pf-list-item-content {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--pf-text-light);
}

.pf-list-item-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pf-list-item-info .dashicons {
    color: var(--pf-primary);
    font-size: 16px;
}

.pf-list-item-info a {
    color: var(--pf-secondary);
    text-decoration: none;
    font-weight: 600;
}

.pf-list-item-info a:hover {
    text-decoration: underline;
}

/* Mapa */
.pro-farmacias-map-container {
    margin-top: 30px;
    border-radius: var(--pf-radius);
    overflow: hidden;
    box-shadow: var(--pf-shadow);
    border: 1px solid var(--pf-border);
}

#pro-farmacias-map {
    width: 100%;
    height: 400px;
    background-color: var(--pf-light);
}

/* Widget en sidebar */
.widget.pro_farmacias_widget {
    margin-bottom: 30px;
}

.widget.pro_farmacias_widget .widget-title {
    color: var(--pf-dark);
    margin-bottom: 20px;
}

/* Widget contenedor */
.pro-farmacias-widget-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Widget card */
.pf-widget-card {
    background: #ffffff;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--pf-transition);
}

.pf-widget-card:hover {
    border-color: var(--pf-primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pf-widget-card-inner {
    padding: 16px;
}

.pf-widget-card-image {
    margin: -16px -16px 16px -16px;
    height: 150px;
    overflow: hidden;
}

.pf-widget-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pf-widget-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--pf-dark);
}

.pf-widget-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pf-municipio-tag,
.pf-tipo-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.pf-municipio-tag {
    background-color: var(--pf-light);
    color: var(--pf-primary);
}

.pf-tipo-tag {
    background-color: var(--pf-accent);
    color: #ffffff;
}

/* Widget compacto */
.pf-widget-compact {
    background: #ffffff;
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    padding: 12px;
    transition: var(--pf-transition);
}

.pf-widget-compact:hover {
    border-color: var(--pf-primary);
    background-color: rgba(46, 125, 50, 0.02);
}

.pf-widget-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pf-widget-compact-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-dark);
}

.pf-widget-compact-badge {
    font-size: 10px;
    color: var(--pf-text-light);
    text-transform: uppercase;
}

.pf-widget-compact-phone {
    font-size: 14px;
}

.pf-phone-link {
    color: var(--pf-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.pf-phone-link:hover {
    color: var(--pf-primary);
}

.pf-phone-link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Footer del widget */
.pro-farmacias-widget-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pf-border);
    text-align: center;
}

.pro-farmacias-ver-todas {
    color: var(--pf-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.pro-farmacias-ver-todas:hover {
    color: var(--pf-secondary);
    text-decoration: underline;
}

/* Estados vacíos */
.pro-farmacias-no-results,
.pro-farmacias-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--pf-text-light);
    font-size: 16px;
    background-color: var(--pf-light);
    border-radius: var(--pf-radius);
    border: 2px dashed var(--pf-border);
}

/* Cargando */
.pro-farmacias-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--pf-primary);
}

.pro-farmacias-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--pf-light);
    border-top-color: var(--pf-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pro-farmacias-wrapper[data-formato="cards"] {
        grid-template-columns: 1fr;
    }
    
    .pf-widget-guardia {
        flex-direction: column;
    }
    
    .pf-widget-image {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    .pf-widget-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .pf-widget-badge {
        align-self: flex-start;
    }
    
    .pf-widget-actions {
        flex-direction: column;
    }
    
    .pf-button {
        width: 100%;
        justify-content: center;
    }
    
    #pro-farmacias-map {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .pf-widget-title {
        font-size: 18px;
    }
    
    .pf-widget-info {
        font-size: 13px;
    }
    
    .pf-list-item-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .pf-widget-card-image {
        height: 120px;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    :root {
        --pf-light: #1a1a1a;
        --pf-dark: #f0f0f0;
        --pf-text: #e0e0e0;
        --pf-text-light: #b0b0b0;
        --pf-border: #333333;
    }
    
    .pf-widget-guardia,
    .pf-list-item,
    .pf-widget-card,
    .pf-widget-compact {
        background-color: #2a2a2a;
    }
    
    .pf-widget-badge {
        background-color: var(--pf-accent);
    }
    
    .pro-farmacias-no-results,
    .pro-farmacias-empty {
        background-color: #2a2a2a;
        border-color: #444444;
    }
}

/* Print styles */
@media print {
    .pf-widget-actions,
    .pf-button,
    .pro-farmacias-widget-footer {
        display: none !important;
    }
    
    .pf-widget-guardia {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .pf-widget-image {
        max-width: 100px;
        max-height: 100px;
    }
}