/* =========================================
   GRID LOGROS WIDGET STYLES (Exclusive)
   ========================================= */

/* --- GRID LAYOUT CARD (V2) --- */
/* --- GRID LAYOUT CARD (V2) - CLEAN FOR ELEMENTOR --- */
.alezux-logro-card-v2 {
    display: flex;
    flex-direction: column;
    /* Border, Radius, Shadow, Background controlled by Elementor */
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    /* Default font, overrideable */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.alezux-logro-card-v2:hover {
    transform: translateY(-5px);
    /* Box shadow hover controlled by Elementor */
}

/* Sección Superior: Imagen o Fondo Blanco */
.alezux-card-v2-top {
    width: 100%;
    height: 200px;
    /* Default height, controlled by Elementor */
    background-color: #ffffff;
    /* Fallback */
    background-size: cover;
    background-position: center;
    position: relative;
    /* Height controlled by Elementor selector */
}

/* Badge del Curso */
.alezux-card-v2-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    /* Typography, Colors, Padding, Border Radius controlled by Elementor */
    display: inline-block;
    z-index: 2;
}

/* Sección Inferior: Cuerpo Oscuro */
.alezux-card-v2-body {
    /* Background controlled by Elementor (or inherit from card if convenient, but separate control is better) */
    padding: 25px;
    /* Default padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

/* Mensaje del Logro */
.alezux-card-v2-message {
    /* Typography and Color controlled by Elementor */
    line-height: 1.6;
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer: Datos + Botón */
.alezux-card-v2-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Info Estudiante */
.alezux-card-v2-student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alezux-card-v2-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    /* Border controlled by Elementor */
}

.alezux-card-v2-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.alezux-card-v2-name {
    /* Typography and Color controlled by Elementor */
    margin-bottom: 2px;
}

.alezux-card-v2-date {
    /* Typography and Color controlled by Elementor */
}

/* Botón Ver Logro */
.alezux-card-v2-btn {
    /* Typography, Colors, Padding, Border, Radius controlled by Elementor */
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

/* Elementor handles hover states via selectors */

/* Estilos para el Grid Container si son necesarios */
.alezux-logros-grid {
    display: grid;
    /* Grid template columns handled by elementor or inline */
    gap: 20px;
}

/* Estilos para el Popup (que usa Grid) */
.alezux-logro-popup-overlay {
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    display: none;
}

.alezux-logro-popup-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.alezux-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    z-index: 10;
}

.popup-image-el {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 5px;
    background: #f0f0f0;
}

.popup-student-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.popup-avatar-el {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.popup-student-el {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.popup-message-el {
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
    font-size: 14px;
}


/* Wrapper del Formulario */
.alezux-logro-form-wrapper {
    width: 100%;
    margin: 0 auto;
    font-family: 'Inter', 'Roboto', sans-serif;
}

/* Form Container */
.alezux-logro-form-wrapper .alezux-logro-form {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    /* Base color, Elementor can override */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.alezux-logro-form-wrapper .alezux-logro-form-group {
    margin-bottom: 24px;
    position: relative;
}

/* Labels */
.alezux-logro-form-wrapper .alezux-logro-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    letter-spacing: 0.02em;
}

/* Inputs y Selects */
.alezux-logro-form-wrapper .alezux-logro-input {
    width: 100%;
    padding: 14px 16px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    min-height: 45px;
}

.alezux-logro-form-wrapper .alezux-logro-input:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.alezux-logro-form-wrapper textarea.alezux-logro-input {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Select Styling Override */
.alezux-logro-form-wrapper select.alezux-logro-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Caja de carga (Upload Box) */
.alezux-logro-form-wrapper .alezux-upload-box {
    border: 2px dashed #d1d5db;
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    overflow: hidden;
}

.alezux-logro-form-wrapper .alezux-upload-box:hover {
    /* Hover styles handled by Elementor or fallback handled delicately if needed, 
       but removing hardcoded here allows Elementor control */
}

/* Content Placeholder */
.alezux-logro-form-wrapper .alezux-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    z-index: 2;
}

/* Icon - Weak Styling */
.alezux-logro-form-wrapper .alezux-upload-icon i,
.alezux-logro-form-wrapper .alezux-upload-icon svg {
    font-size: 48px;
    /* color: #64748b; REMOVED to allow Elementor default */
    margin-bottom: 8px;
    display: inline-block;
    line-height: 1;
    /* fill: #64748b; REMOVED */
}

.alezux-logro-form-wrapper .alezux-upload-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin: 0;
}

.alezux-logro-form-wrapper .alezux-upload-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    max-width: 280px;
    line-height: 1.5;
    margin: 0;
}

/* Fake Button Look */
.alezux-logro-form-wrapper .alezux-upload-button-wrapper {
    margin-top: 10px;
    pointer-events: auto;
    /* Re-enable pointer events if we want exact button clicks, but box click is handled */
}

.alezux-logro-form-wrapper .alezux-upload-btn-fake {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.alezux-logro-form-wrapper .alezux-upload-box:hover .alezux-upload-btn-fake {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Preview de imagen */
.alezux-logro-form-wrapper .alezux-upload-preview {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    background: transparent;
}

.alezux-logro-form-wrapper .alezux-upload-preview img {
    max-height: 220px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.alezux-logro-form-wrapper .alezux-remove-img {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    z-index: 10;
}

/* Boton Submit */
.alezux-logro-form-wrapper .alezux-logro-form-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

.alezux-logro-form-wrapper .alezux-logro-submit {
    padding: 14px 32px;
    background-color: #3b82f6;
    /* Flat color instead of gradient for easier override */
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alezux-logro-form-wrapper .alezux-logro-submit:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

/* Mensajes de respuesta */
.alezux-logro-form-wrapper #alezux-logro-response {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.alezux-logro-form-wrapper .alezux-success {
    background-color: #ecfdf5;
    color: #047857;
    padding: 15px;
    border-left: 5px solid #10b981;
}

.alezux-logro-form-wrapper .alezux-error {
    background-color: #fef2f2;
    color: #b91c1c;
    padding: 15px;
    border-left: 5px solid #ef4444;
}

.alezux-logros-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.alezux-logros-filters input,
.alezux-logros-filters select {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

/* =========================================
   NEW CARD LAYOUT STYLES - DARK/GREEN V2
   ========================================= */

/* =========================================
   LOGRO CARD LAYOUT - HORIZONTAL DARK (V3)
   ========================================= */

.alezux-logro-card {
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    background-color: #0f0f0f;
    /* Dark background similar to image */
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    align-items: stretch;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alezux-logro-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: #333;
}

/* --- LEFT COLUMN: IMAGE --- */
.alezux-card-image {
    flex: 0 0 150px;
    /* Fixed width for image container */
    width: 150px;
    height: 150px;
    /* Square */
    background-color: #ffffff;
    /* White placeholder bg as seen in image */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alezux-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Or cover depending on preference for logotypes */
}

.alezux-card-placeholder-img {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
}

/* --- RIGHT COLUMN: CONTENT --- */
.alezux-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Distributors header top, footer bottom */
}

/* HEADER: Badge + Date */
.alezux-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.alezux-course-badge {
    display: inline-block;
    background-color: #1a472a;
    /* Dark green pill bg */
    color: #4ade80;
    /* Light green text */
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.alezux-card-date {
    font-size: 13px;
    color: #a0a0a0;
}

/* BODY: Message */
.alezux-card-message {
    color: #e5e5e5;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex-grow: 1;
    /* Pushes footer down if text is short, expands if long */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Text truncation as shown in image "..." */
}

/* FOOTER: Student + Actions */
.alezux-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #1f1f1f;
    /* Optional separator? Image doesn't show clearly, maybe none */
    padding-top: 10px;
    margin-top: 5px;
}

/* Override border-top if not desired, image looks clean. Let's remove border for now to match clean look */
.alezux-card-footer {
    border-top: none;
    padding-top: 0;
}

/* Student Info */
.alezux-card-student {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alezux-student-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alezux-student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alezux-student-avatar i {
    font-size: 14px;
    color: #fff;
}

.alezux-student-name {
    font-size: 13px;
    color: #d4d4d4;
    font-weight: 500;
}

/* Action Buttons */
.alezux-card-actions {
    display: flex;
    gap: 10px;
}

.alezux-btn-card-action {
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    outline: none;
}

/* Edit Button - Green Dark */
.alezux-btn-card-edit {
    background-color: #1a472a;
    color: #4ade80;
    border: 1px solid #1a472a;
}

.alezux-btn-card-edit:hover {
    background-color: #143620;
    border-color: #4ade80;
}

/* Delete Button - Red/Orange */
.alezux-btn-card-delete {
    background-color: #ff3b30;
    /* Bright red like image */
    color: #ffffff;
}

.alezux-btn-card-delete:hover {
    background-color: #d32f2f;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .alezux-logro-card {
        flex-direction: column;
    }

    .alezux-card-image {
        width: 100%;
        height: 200px;
        /* Larger image area on mobile */
    }

    .alezux-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .alezux-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .alezux-btn-card-action {
        flex: 1;
        text-align: center;
    }
}

/* Custom Modals (Mantener estilos de modal existentes) */

.alezux-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alezux-modal[style*="display: block"] {
    display: flex !important;
}

.alezux-delete-modal-content {
    background-color: #18181b;
    color: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid #27272a;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    margin: auto;
}

.alezux-delete-icon {
    font-size: 30px;
    color: #ef4444;
    margin-bottom: 20px;
}

.alezux-delete-modal-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
}

.alezux-delete-modal-content p {
    color: #a1a1aa;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.alezux-delete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.alezux-btn-cancel {
    background: transparent;
    border: 1px solid #3f3f46;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
}

.alezux-btn-cancel:hover {
    background: #27272a;
}

.alezux-btn-danger-confirm {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.alezux-btn-danger-confirm:hover {
    background: #dc2626;
}

.alezux-modal-content {
    margin: auto;
}