/**
 * Estilos para el frontend del plugin Event Invitations Manager
 *
 * @package EventInvitationsManager
 * @subpackage EventInvitationsManager/public/css
 */

/* Contenedor principal de invitaciones */
.eim-invitation-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Detalles del evento */
.eim-event-details {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.eim-event-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #1d2327;
    text-align: center;
}

.eim-event-info {
    display: grid;
    gap: 10px;
}

.eim-event-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eim-event-info-icon {
    width: 20px;
    height: 20px;
    fill: #646970;
}

.eim-event-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
    color: #646970;
    line-height: 1.6;
}

/* Formulario RSVP */
.eim-rsvp-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.eim-rsvp-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1d2327;
    text-align: center;
}

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

.eim-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1d2327;
}

.eim-form-input,
.eim-form-textarea,
.eim-form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.eim-form-input:focus,
.eim-form-textarea:focus,
.eim-form-select:focus {
    outline: none;
    border-color: #0073aa;
}

.eim-form-textarea {
    height: 100px;
    resize: vertical;
}

/* Opciones de respuesta RSVP */
.eim-rsvp-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.eim-rsvp-option {
    position: relative;
}

.eim-rsvp-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.eim-rsvp-option label {
    display: block;
    padding: 15px;
    text-align: center;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.eim-rsvp-option input[type="radio"]:checked+label {
    border-color: #0073aa;
    background: #f0f6fc;
    color: #0073aa;
}

.eim-rsvp-option-yes input[type="radio"]:checked+label {
    border-color: #00a32a;
    background: #f0f9f0;
    color: #00a32a;
}

.eim-rsvp-option-no input[type="radio"]:checked+label {
    border-color: #d63638;
    background: #fdf0f0;
    color: #d63638;
}

/* Campos adicionales */
.eim-additional-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.eim-guest-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eim-counter-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e1e1e1;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.eim-counter-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.eim-counter-value {
    min-width: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* Botón de envío */
/* .eim-submit-btn,
.eim-btn-primary {
    padding: 15px 30px;
    background: #0073aa;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
} */

/* .eim-submit-btn:hover,
#eim-submit-btn:hover,
.eim-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
} */

.eim-submit-btn:disabled,
#eim-submit-btn:disabled,
.eim-btn-primary:disabled {
    background: #e1e1e1;
    color: #646970 !important;
    cursor: not-allowed;
}

/* Estados de respuesta */
.eim-response-message {
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 20px;
}

.eim-response-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #10b981;
}

.eim-response-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

/* Estado de invitación */
.eim-invitation-status {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.eim-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Estados con colores de Notion */
.eim-status-badge.confirmed,
.eim-status-badge.asiste {
    background: #DBE6DD;
    color: #2A533C;
}

.eim-status-badge.declined,
.eim-status-badge.no-asiste {
    background: #F9DCD9;
    color: #6D3531;
}

.eim-status-badge.pending,
.eim-status-badge.pendiente {
    background: #F3E3C2;
    color: #655121;
}

/* Loading */
.eim-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.eim-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: eim-spin 1s linear infinite;
}

@keyframes eim-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .eim-invitation-container {
        margin: 10px;
        padding: 15px;
    }

    .eim-rsvp-options {
        grid-template-columns: 1fr;
    }

    .eim-guest-counter {
        justify-content: center;
    }

    .eim-event-info {
        gap: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .eim-invitation-container {
        background: #1e1e1e;
        color: #fff;
    }

    .eim-event-details {
        background: #2d2d2d;
    }

    .eim-rsvp-form {
        background: #1e1e1e;
        border-color: #404040;
    }

    .eim-form-input,
    .eim-form-textarea,
    .eim-form-select {
        background: #2d2d2d;
        border-color: #404040;
        color: #fff;
    }

    .eim-rsvp-option label {
        background: #2d2d2d;
        border-color: #404040;
        color: #fff;
    }
}

/* ===== FORMULARIO DINÁMICO DE EVENTO ===== */

.eim-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.eim-event-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.eim-event-header .eim-event-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: bold;
}

.eim-event-header .eim-event-description {
    margin: 15px 0;
    opacity: 0.9;
    line-height: 1.6;
}

.eim-event-header .eim-event-info {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.eim-event-header .eim-event-date,
.eim-event-header .eim-event-location {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
    font-size: 14px;
}

.eim-event-form {
    padding: 40px;
}

.eim-field-group {
    margin-bottom: 25px;
}

.eim-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
}

.eim-required {
    color: #d63638;
    margin-left: 3px;
}

.eim-field-input,
.eim-field-textarea,
.eim-field-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.eim-field-input:focus,
.eim-field-textarea:focus,
.eim-field-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.eim-field-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.eim-field-help {
    display: block;
    margin-top: 5px;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* Campos radio */
.eim-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eim-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.eim-radio-label input[type="radio"] {
    margin-right: 10px;
    width: auto;
}

.eim-radio-label input[type="radio"]:checked+.eim-radio-text {
    font-weight: 600;
}

/* .eim-radio-label:has(input:checked) {
    border-color: #0073aa;
    background: #f0f6fc;
    color: #0073aa;
} */

/* Campos checkbox */
.eim-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    line-height: 1.5;
}
/* 
.eim-checkbox-label:hover {
    border-color: #0073aa;
    background: #f9f9f9;
} */

.eim-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: auto;
    flex-shrink: 0;
}

/* .eim-checkbox-label:has(input:checked) {
    border-color: #0073aa;
    background: #f0f6fc;
    color: #0073aa;
} */

/* Títulos de sección del formulario */
.eim-form-section-title {
    margin-bottom: 20px !important;
    color: #333 !important;
    border-bottom: 2px solid #0073aa !important;
    padding-bottom: 10px !important;
    font-size: 1.5em !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
}

/* Botón de envío */
.eim-submit-group {
    margin-top: 40px;
    text-align: center;
}

.eim-submit-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.eim-submit-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.eim-form-loading {
    margin-top: 15px;
    color: #646970;
    font-style: italic;
}

/* Estados de error */
.eim-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #dc2626;
    margin: 20px 0;
}

.eim-notice {
    background: #dbeafe;
    color: #1e40af;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #1e40af;
    margin: 20px 0;
}

/* Responsive para formulario dinámico */
@media (max-width: 768px) {
    .eim-form-wrapper {
        margin: 10px;
        border-radius: 0;
    }

    .eim-event-header {
        padding: 20px;
    }

    .eim-event-header .eim-event-title {
        font-size: 24px;
    }

    .eim-event-header .eim-event-info {
        flex-direction: column;
        gap: 15px;
    }

    .eim-event-form {
        padding: 20px;
    }

    .eim-radio-group {
        gap: 8px;
    }

    .eim-radio-label,
    .eim-checkbox-label {
        padding: 10px;
    }

    .eim-submit-button {
        width: 100%;
        padding: 15px;
    }
}

/* Dark mode para formulario dinámico */
@media (prefers-color-scheme: dark) {
    .eim-form-wrapper {
        background: #1e1e1e;
        color: #fff;
    }

    .eim-event-form {
        background: #1e1e1e;
    }

    .eim-field-label {
        color: #fff;
    }

    .eim-field-input,
    .eim-field-textarea,
    .eim-field-select {
        background: #2d2d2d;
        border-color: #404040;
        color: #fff;
    }

    .eim-radio-label,
    .eim-checkbox-label {
        background: #2d2d2d;
        border-color: #404040;
        color: #fff;
    }

    .eim-radio-label:hover,
    .eim-checkbox-label:hover {
        background: #3d3d3d;
    }

    .eim-field-help {
        color: #a0a0a0;
    }
}

/* ===== ESTILOS ESPECÍFICOS PARA ELEMENTOR ===== */

/* Asegurar que los estilos del widget se apliquen correctamente en Elementor */
.elementor-widget-eim_dynamic_form .eim-form-wrapper {
    border-radius: 8px;
    overflow: hidden;
}

.elementor-widget-eim_dynamic_form .eim-event-header {
    background: linear-gradient(135deg, var(--header-bg, #0073aa) 0%, var(--header-bg-hover, #005a87) 100%);
}

.elementor-widget-eim_dynamic_form .eim-submit-button {
    background: linear-gradient(135deg, var(--button-bg, #0073aa) 0%, var(--button-bg-hover, #005a87) 100%);
    color: var(--button-text-color, #ffffff);
}

.elementor-widget-eim_dynamic_form .eim-submit-button:hover {
    background: var(--button-bg-hover, #005a87);
}

/* Editor de Elementor - vista previa */
.elementor-editor-active .eim-form-wrapper {
    pointer-events: none;
}

.elementor-editor-active .eim-submit-button {
    cursor: default;
}

/* Responsive específico para Elementor */
@media (max-width: 768px) {
    .elementor-widget-eim_dynamic_form .eim-event-header {
        padding: 20px 15px;
    }

    .elementor-widget-eim_dynamic_form .eim-event-form {
        padding: 20px 15px;
    }
}

/* =================================================================== */
/* INVITATION TYPE SELECTOR - Nueva funcionalidad */
/* =================================================================== */

/* Selector de tipo de invitación */
.eim-invitation-selector {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
}

.eim-selector-buttons {
    display: flex !important;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Botones de invitación */
.eim-invitation-btn {
    flex: 1 1 250px;
    max-width: 250px;
    min-width: 200px;
    padding: 25px 20px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    color: #333 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

#eim-btn-family, #eim-btn-individual {
    display: flex !important;
}

.eim-invitation-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.eim-btn-icon {
    display: block !important;
    width: 100%;
    font-size: 32px;
    margin-bottom: 5px;
    line-height: 1;
}

.eim-btn-icon svg {
    display: block;
    margin: 0 auto;
    width: 48px;
    height: 48px;
    stroke: currentColor;
}

.eim-btn-text {
    display: block !important;
    width: 100%;
    font-size: 18px;
    font-weight: bold;
    color: inherit;
    margin-bottom: 5px;
    line-height: 1.3;
    word-wrap: break-word;
}

.eim-btn-desc {
    display: block !important;
    width: 100%;
    font-size: 14px;
    color: inherit;
    opacity: 0.8;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Formularios ocultos inicialmente */
.eim-form-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.eim-form-visible {
    opacity: 1;
    max-height: none;
    overflow: visible;
}

/* Contenedores de formularios */
.eim-invitation-form {
    margin-top: 20px;
    animation: fadeIn 0.4s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formulario familiar específico */
.eim-family-info {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.eim-family-info p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #646970;
}

.eim-family-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eim-family-counter span {
    font-size: 16px;
    color: #1d2327;
}

.eim-family-counter strong {
    color: #2271b1;
    font-size: 18px;
}

/* Formulario único para agregar personas */
#eim-family-single-form {
    margin-bottom: 25px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

#eim-family-single-form h4 {
    margin: 0 0 20px 0;
    color: #1d2327;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.eim-family-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.eim-add-person-btn:disabled {
    background: #646970;
    cursor: not-allowed;
    transform: none;
}

.eim-cancel-person-btn {
    background: #646970;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eim-cancel-person-btn:hover {
    background: #50575e;
    transform: translateY(-1px);
}

/* Lista de personas confirmadas */
#eim-family-added-list {
    margin-bottom: 25px;
}

#eim-family-added-list h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 18px;
}

.eim-confirmed-person {
    margin-bottom: 15px;
    padding: 15px;
    background: #e8f5e8;
    border: 2px solid #46b450;
    border-radius: 6px;
    animation: slideInUp 0.3s ease-out;
}

.eim-confirmed-person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eim-confirmed-person-header span {
    color: #1d2327;
    font-size: 16px;
}

.eim-confirmed-person-header div {
    display: flex;
    gap: 10px;
}

.eim-edit-person {
    background: #2271b1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eim-edit-person:hover {
    background: #135e96;
    transform: translateY(-1px);
}

.eim-remove-person {
    background: #d63638;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eim-remove-person:hover {
    background: #b32d2e;
    transform: translateY(-1px);
}

/* Responsive para selector */
@media (max-width: 768px) {
    .eim-selector-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .eim-invitation-btn {
        max-width: none;
        width: 100%;
    }

    .eim-btn-text {
        font-size: 16px;
    }

    .eim-btn-icon {
        font-size: 28px;
    }
}