/* Expediente Clínico Veterinario - Public Styles */

/* ===== Variables ===== */
:root {
    --ecv-primary: #667eea;
    --ecv-primary-dark: #5568d3;
    --ecv-secondary: #764ba2;
    --ecv-success: #4caf50;
    --ecv-danger: #f44336;
    --ecv-warning: #ff9800;
    --ecv-info: #2196f3;
    --ecv-light: #f8f9fa;
    --ecv-dark: #333;
    --ecv-border: #ddd;
    --ecv-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== Container General ===== */
.ecv-expediente-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Formularios ===== */
.ecv-form-search {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--ecv-shadow);
    margin: 20px 0;
}

.ecv-form-group {
    margin-bottom: 20px;
}

.ecv-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ecv-dark);
}

.ecv-input-search,
.ecv-public-form input[type="text"],
.ecv-public-form input[type="email"],
.ecv-public-form input[type="tel"],
.ecv-public-form textarea,
.ecv-public-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--ecv-border);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

.ecv-input-search:focus,
.ecv-public-form input:focus,
.ecv-public-form textarea:focus,
.ecv-public-form select:focus {
    outline: none;
    border-color: var(--ecv-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ecv-input-search.ecv-error,
.ecv-public-form input.ecv-error,
.ecv-public-form textarea.ecv-error {
    border-color: var(--ecv-danger);
}

.ecv-error-msg {
    display: block;
    color: var(--ecv-danger);
    font-size: 14px;
    margin-top: 5px;
}

/* ===== Botones ===== */
.ecv-btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.ecv-btn-primary {
    background: var(--ecv-primary);
    color: white;
}

.ecv-btn-primary:hover {
    background: var(--ecv-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ecv-btn-secondary {
    background: var(--ecv-secondary);
    color: white;
}

.ecv-btn-secondary:hover {
    background: #6a3f8f;
}

.ecv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Resultados de búsqueda ===== */
.ecv-results {
    margin-top: 30px;
}

.ecv-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.ecv-paciente-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--ecv-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid var(--ecv-primary);
}

.ecv-paciente-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ecv-paciente-card h3 {
    margin-top: 0;
    color: var(--ecv-primary);
    font-size: 20px;
}

.ecv-paciente-card p {
    margin: 10px 0;
    color: #666;
}

/* ===== Widget de búsqueda rápida ===== */
.ecv-search-widget {
    position: relative;
    margin: 20px 0;
}

.ecv-quick-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--ecv-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--ecv-shadow);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.ecv-quick-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ecv-quick-results li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--ecv-light);
    cursor: pointer;
    transition: background 0.2s;
}

.ecv-quick-results li:hover {
    background: var(--ecv-light);
}

.ecv-quick-results li:last-child {
    border-bottom: none;
}

/* ===== Widget de citas ===== */
.ecv-citas-widget {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--ecv-shadow);
    margin: 20px 0;
}

.ecv-citas-widget h3 {
    margin-top: 0;
    color: var(--ecv-primary);
    border-bottom: 2px solid var(--ecv-primary);
    padding-bottom: 10px;
}

.ecv-citas-list-public {
    margin-top: 20px;
}

.ecv-cita-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--ecv-border);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ecv-cita-card:hover {
    transform: translateX(5px);
    box-shadow: var(--ecv-shadow);
}

.ecv-cita-date {
    background: var(--ecv-primary);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
    margin-right: 15px;
}

.ecv-day {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.ecv-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
}

.ecv-cita-details {
    flex: 1;
}

.ecv-cita-details h4 {
    margin: 0 0 5px;
    color: var(--ecv-dark);
}

.ecv-cita-time {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.ecv-cita-time .dashicons {
    vertical-align: middle;
}

.ecv-cita-type {
    color: #999;
    font-size: 13px;
    margin: 5px 0;
}

/* ===== Badges ===== */
.ecv-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ecv-badge-programada {
    background: #e3f2fd;
    color: #1976d2;
}

.ecv-badge-confirmada {
    background: #e8f5e9;
    color: #388e3c;
}

.ecv-badge-completada {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ecv-badge-cancelada {
    background: #ffebee;
    color: #d32f2f;
}

/* ===== Loading ===== */
.ecv-loading-container {
    text-align: center;
    padding: 40px;
}

.ecv-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ecv-light);
    border-top: 4px solid var(--ecv-primary);
    border-radius: 50%;
    animation: ecv-spin 1s linear infinite;
}

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

/* ===== Alertas ===== */
.ecv-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid;
}

.ecv-alert-success {
    background: #e8f5e9;
    border-color: var(--ecv-success);
    color: #2e7d32;
}

.ecv-alert-error {
    background: #ffebee;
    border-color: var(--ecv-danger);
    color: #c62828;
}

.ecv-alert-warning {
    background: #fff3e0;
    border-color: var(--ecv-warning);
    color: #e65100;
}

.ecv-alert-info {
    background: #e3f2fd;
    border-color: var(--ecv-info);
    color: #1565c0;
}

/* ===== Notificaciones ===== */
.ecv-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.ecv-notification.show {
    transform: translateX(0);
}

.ecv-notification-success {
    border-left: 4px solid var(--ecv-success);
}

.ecv-notification-error {
    border-left: 4px solid var(--ecv-danger);
}

.ecv-notification-info {
    border-left: 4px solid var(--ecv-info);
}

/* ===== Modal ===== */
.ecv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.ecv-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.ecv-modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.ecv-modal-close:hover {
    color: var(--ecv-dark);
}

/* ===== Botón volver arriba ===== */
.ecv-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--ecv-primary);
    color: white;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--ecv-shadow);
    display: none;
    transition: all 0.3s;
    z-index: 999;
}

.ecv-back-to-top:hover {
    background: var(--ecv-primary-dark);
    transform: translateY(-5px);
}

/* ===== FAQ Accordion ===== */
.ecv-faq-question {
    background: white;
    padding: 15px 20px;
    border: 1px solid var(--ecv-border);
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.ecv-faq-question:hover {
    background: var(--ecv-light);
}

.ecv-faq-question.active {
    background: var(--ecv-primary);
    color: white;
}

.ecv-faq-answer {
    padding: 15px 20px;
    border: 1px solid var(--ecv-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    margin-bottom: 10px;
    display: none;
}

/* ===== Mensajes vacíos ===== */
.ecv-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* ===== Tablas responsive ===== */
.ecv-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ecv-table-responsive {
    width: 100%;
    margin: 20px 0;
}

.ecv-table-responsive table {
    width: 100%;
    border-collapse: collapse;
}

.ecv-table-responsive th,
.ecv-table-responsive td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--ecv-border);
}

.ecv-table-responsive th {
    background: var(--ecv-light);
    font-weight: 600;
    color: var(--ecv-dark);
}

.ecv-table-responsive tr:hover {
    background: #f9f9f9;
}

/* ===== Imágenes lazy loading ===== */
img.ecv-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.ecv-lazy.loaded {
    opacity: 1;
}

/* ===== Breadcrumbs ===== */
.ecv-breadcrumbs {
    padding: 15px 0;
    margin-bottom: 20px;
}

.ecv-breadcrumbs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.ecv-breadcrumbs li {
    display: inline-flex;
    align-items: center;
}

.ecv-breadcrumbs li + li:before {
    content: "›";
    padding: 0 10px;
    color: #999;
}

.ecv-breadcrumbs a {
    color: var(--ecv-primary);
    text-decoration: none;
}

.ecv-breadcrumbs a:hover {
    text-decoration: underline;
}

/* ===== Paginación ===== */
.ecv-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.ecv-pagination a,
.ecv-pagination span {
    padding: 8px 12px;
    border: 1px solid var(--ecv-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--ecv-dark);
    transition: all 0.3s;
}

.ecv-pagination a:hover {
    background: var(--ecv-primary);
    color: white;
    border-color: var(--ecv-primary);
}

.ecv-pagination .current {
    background: var(--ecv-primary);
    color: white;
    border-color: var(--ecv-primary);
}

/* ===== Compatibilidad con Divi ===== */
.et_pb_module .ecv-expediente-container {
    max-width: 100%;
}

.et_pb_section .ecv-btn {
    font-family: inherit;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .ecv-expediente-container {
        padding: 15px;
    }
    
    .ecv-form-search {
        padding: 20px;
    }
    
    .ecv-results-grid {
        grid-template-columns: 1fr;
    }
    
    .ecv-paciente-card {
        padding: 20px;
    }
    
    .ecv-cita-card {
        flex-direction: column;
        text-align: center;
    }
    
    .ecv-cita-date {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .ecv-btn {
        display: block;
        width: 100%;
    }
    
    .ecv-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .ecv-notification {
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .ecv-modal-content {
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .ecv-form-group label {
        font-size: 14px;
    }
    
    .ecv-input-search,
    .ecv-btn {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .ecv-paciente-card h3 {
        font-size: 18px;
    }
}

/* ===== Modo oscuro (opcional) ===== */
@media (prefers-color-scheme: dark) {
    .ecv-dark-mode {
        --ecv-light: #2d2d2d;
        --ecv-dark: #f5f5f5;
        --ecv-border: #444;
    }
    
    .ecv-dark-mode .ecv-form-search,
    .ecv-dark-mode .ecv-paciente-card,
    .ecv-dark-mode .ecv-citas-widget {
        background: #1e1e1e;
        color: #f5f5f5;
    }
}

/* ===== Animaciones adicionales ===== */
@keyframes ecv-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ecv-fade-in {
    animation: ecv-fadeIn 0.5s ease-out;
}

@keyframes ecv-slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ecv-slide-in {
    animation: ecv-slideInRight 0.4s ease-out;
}

/* ===== Utilidades ===== */
.ecv-text-center {
    text-align: center;
}

.ecv-text-right {
    text-align: right;
}

.ecv-text-left {
    text-align: left;
}

.ecv-mt-10 { margin-top: 10px; }
.ecv-mt-20 { margin-top: 20px; }
.ecv-mt-30 { margin-top: 30px; }

.ecv-mb-10 { margin-bottom: 10px; }
.ecv-mb-20 { margin-bottom: 20px; }
.ecv-mb-30 { margin-bottom: 30px; }

.ecv-hide { display: none; }
.ecv-show { display: block; }

/* ===== Print Styles ===== */
@media print {
    .ecv-btn,
    .ecv-back-to-top,
    .ecv-search-widget,
    .ecv-notification {
        display: none !important;
    }
    
    .ecv-paciente-card,
    .ecv-cita-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}
