/* Reset y base del botón */
button.close-btn {
    all: unset;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    background-color: #ff4444;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button.close-btn:hover {
    background-color: #ff0000;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

button.close-btn i.fas.fa-times {
    font-size: 16px;
    color: white;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* Estilos generales */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: #1e293b;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor principal */
.main-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1400px;
    gap: 24px;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    animation: slideIn 0.8s ease-out forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Formulario */
.form-container {
    width: 60%;
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(52,152,219,0.08);
    border: 1px solid rgba(226,232,240,0.6);
    animation: formEntry 1s ease-out forwards;
}

@keyframes formEntry {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}
/* Vista previa en tamaño carta */
#realTimePreview {
    width: 215.9mm;
    height: 279.4mm;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Vista previa */
.preview-container {
    width: 45%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    display: flex;
    justify-content: center;
    padding: 20px;
    top: 20px;
    align-self: flex-start;
    height: fit-content;
    animation: previewEntry 1s ease-out forwards;
}

@keyframes previewEntry {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.preview-container.reapply-animation {
    animation: previewEntry 0.5s ease-out forwards;
}

.preview-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 20px rgba(52,152,219,0.06);
    overflow-y: auto;
    height: 842px;
    width: 100%;
    max-width: 595px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(52,152,219,0.1);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-header select {
    max-width: 200px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.preview-header select:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.photo-controls {
    display: flex;
    gap: 4px;
}

.photo-controls .pos-option,
.photo-controls .shape-option {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #475569;
    font-size: 16px;
    transition: all 0.25s ease;
    flex: none;
}

.photo-controls .pos-option:hover,
.photo-controls .shape-option:hover {
    border-color: #3498db;
    color: #3498db;
    background: #eff6ff;
}

.photo-controls .pos-option.selected,
.photo-controls .shape-option.selected {
    border-color: #3498db;
    background: #3498db;
    color: #fff;
}

/* Agenda lateral */
.agenda-btn {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    border-radius: 16px;
    width: 60px;
    height: 60px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52,152,219,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.agenda-btn i.fas.fa-address-book {
    font-size: 28px;
}

.agenda-btn:hover {
    background: #2980b9;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 25px rgba(52,152,219,0.5);
}

.agenda-panel {
    position: fixed;
    left: -400px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    transition: left 0.5s ease;
    z-index: 999;
    padding: 24px;
    overflow-y: auto;
}

.agenda-panel.open {
    left: 0;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.agenda-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.agenda-overlay.open {
    display: block;
    opacity: 1;
}

.agenda-panel h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    animation: fadeIn 0.5s ease-in-out;
}

/* Títulos */
#titulo-generador {
    font-size: 2.6em;
    margin-bottom: 24px;
    text-align: center;
    width: 100%;
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    position: relative;
    left: 0;
    transform: none;
    background: linear-gradient(135deg, #1e293b, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

h2#titulo-generador.reapply-animation {
    animation: titleEntry 0.5s ease-out forwards;
}

@keyframes titleEntry {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes erase {
    from { width: 100%; }
    to { width: 0; }
}

@keyframes cursor {
    50% { border-color: transparent; }
}

.section-title {
    font-size: 20px;
    margin-top: 28px;
    color: #1e293b;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.section-title:hover {
    transform: translateX(8px);
    color: #3498db;
}

.section-title i {
    color: #3498db;
    font-size: 18px;
}

/* Personalización */
.customization-panel {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.customization-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    transition: transform 0.3s ease;
}

.customization-title:hover {
    transform: scale(1.02);
}

.customization-title i {
    color: #3498db;
}

.customization-panel > label {
    font-size: 13px;
    color: #1e293b;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    display: block;
}

.color-options, .font-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.color-option:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(0,0,0,0.2);
}

.color-option.selected {
    border: 2px solid #333;
    box-shadow: 0 0 0 2px #fff inset;
    animation: spin 0.5s ease-out;
}

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

.font-option {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.font-option:hover {
    background-color: #eff6ff;
    border-color: #3498db;
    transform: translateY(-2px);
}

.font-option.selected {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Formulario */
label {
    font-weight: 500;
    color: #34495e;
    display: block;
    margin-top: 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}

label:hover {
    color: #3498db;
    transform: translateX(5px);
}

label i {
    color: #3498db;
    width: 18px;
    text-align: center;
    margin-right: 4px;
}

input, select {
    width: 100%;
    padding: 11px 14px;
    margin-top: 6px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

input:focus, select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
    transform: none;
}

/* File inputs custom */
.file-input-wrapper {
    position: relative;
    margin-top: 6px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #475569;
    background: #fafafa;
    font-family: inherit;
}

.file-input-wrapper:hover .file-input-label {
    border-color: #3498db;
    color: #3498db;
    background: #eff6ff;
}

.file-input-label i {
    color: #3498db;
    font-size: 16px;
}

/* Botones */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

button {
    flex: 1;
    padding: 12px 20px;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

button.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

button.primary:hover {
    box-shadow: 0 8px 25px rgba(52,152,219,0.35);
}

button.danger {
    background: #EF4444;
}

button.danger:hover {
    background: #DC2626;
    box-shadow: 0 8px 20px rgba(239,68,68,0.3);
}

/* Lista de CVs guardados */
.saved-cv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.saved-cv-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52,152,219,0.1);
}

.cv-number {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    min-width: 22px;
    text-align: center;
    flex: none;
}

.saved-cv-content {
    flex: 1;
    min-width: 0;
}

.saved-cv-content strong {
    color: #1e293b;
    display: block;
}

.saved-cv-content div {
    color: #475569;
    font-size: 13px;
    margin-top: 2px;
}

.cv-delete-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    background: #EF4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.cv-delete-btn:hover {
    background: #DC2626 !important;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Resto de estilos */
.add-btn {
    color: #3498db;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-weight: 600;
}

.add-btn:hover {
    transform: scale(1.2);
}

.field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.field-row input {
    margin-top: 0;
    flex: 1;
}

.remove-btn {
    flex: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

.remove-btn:hover {
    background: #DC2626;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}

#savedCvsList {
    max-height: 70vh;
    overflow-y: auto;
    padding: 5px;
}

/* Diseño responsivo */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .form-container, .preview-container {
        width: 100%;
    }

    .preview-content {
        width: 100%;
        height: auto;
    }
}

/* Estilos para el campo de búsqueda en la agenda */
.agenda-search {
    width: 100%;
    padding: 10px 14px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.agenda-search:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
    transform: none;
}

.agenda-search::placeholder {
    color: #94a3b8;
}

/* Pantalla de carga */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0f4f8;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.skeleton-body {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
    height: calc(100vh - 80px);
}

.skeleton-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-col-right {
    flex: 0 0 420px;
}

.skeleton-block {
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.skeleton-line {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.skeleton-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.w-90 { width: 90%; }
.w-88 { width: 88%; }
.w-85 { width: 85%; }
.w-80 { width: 80%; }
.w-75 { width: 75%; }
.w-70 { width: 70%; }
.w-65 { width: 65%; }
.w-60 { width: 60%; }
.w-55 { width: 55%; }
.w-50 { width: 50%; }
.w-45 { width: 45%; }
.w-40 { width: 40%; }
.w-35 { width: 35%; }
.w-30 { width: 30%; }
.w-25 { width: 25%; }

.skeleton-preview {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.skeleton-preview-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-avatar {
    width: 64px;
    height: 64px;
    flex: none;
}

.skeleton-preview-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-preview-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

/* Modal de Recorte */
.auto-save-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 99999;
    animation: popIn 0.3s ease;
    border: 2px solid rgba(255,255,255,0.15);
    letter-spacing: 0.3px;
}

.auto-save-indicator i {
    font-size: 16px;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.crop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crop-modal.show {
    display: flex;
    opacity: 1;
}

.crop-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 680px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.crop-modal.show .crop-modal-content {
    transform: translateY(0);
}

.crop-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 16px;
    background: #f8fafc;
}

.crop-modal-footer button {
    flex: 0 1 auto !important;
    min-width: 160px;
    padding: 12px 24px;
    margin: 0;
    box-sizing: border-box;
}

.crop-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.crop-modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-crop-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #334155;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.close-crop-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.crop-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: row;
    gap: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

@media (max-width: 640px) {
    .crop-modal-body {
        flex-direction: column;
        align-items: center;
    }
}

.cropper-container-wrapper {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.cropper-container {
    height: 300px;
    background-color: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px dashed #cbd5e1;
}

.cropper-container img {
    max-width: 100%;
    display: block;
}

.crop-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-control {
    background-color: #f8fafc;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    box-sizing: border-box;
}

.btn-control:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.crop-preview-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e2e8f0;
    padding-left: 24px;
}

@media (max-width: 640px) {
    .crop-preview-wrapper {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e2e8f0;
        padding-top: 20px;
        width: 100%;
    }
}

.crop-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 12px;
    text-align: center;
}

.crop-preview-circle {
    width: 150px;
    height: 150px;
    border-radius: var(--preview-border-radius, 50%);
    overflow: hidden;
    border: 4px solid #3498db;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background-color: #f1f5f9;
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0 0;
}

.zoom-slider-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    cursor: default;
}

.zoom-slider-label input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #cbd5e1;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.zoom-slider-label input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s;
}

.zoom-slider-label input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.zoom-slider-label input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

.zoom-value {
    min-width: 40px;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.zoom-slider-label .fa-search-minus,
.zoom-slider-label .fa-search-plus {
    font-size: 12px;
    color: #94a3b8;
}

/* Redondear el área de selección de Cropper.js */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-view-box {
    outline: 2px dashed #3498db;
    outline-offset: -1px;
}

/* Botón Mágico y Overlay de Carga */
.btn-magic {
    background: linear-gradient(135deg, #a855f7, #3498db);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(168,85,247,0.4);
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-magic:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(168,85,247,0.6);
    filter: brightness(1.1);
}

.btn-magic i {
    animation: sparkle 2s linear infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

.cropper-container {
    position: relative;
}

.cropper-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-radius: 8px;
    box-sizing: border-box;
}

.spinner-magic {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.cropper-loading-text {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    padding: 0 20px;
}

/* Estilos del preloader del Filtro Mágico */
.btn-preload {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.btn-preload:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-preload.downloaded {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.btn-preload i.fa-spin {
    color: #3498db;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Pantalla de carga con spinner */
.carga-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carga-overlay.show {
    opacity: 1;
}

.carga-card {
    text-align: center;
}

.carga-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring-border {
    position: absolute;
    width: 68px;
    height: 68px;
    border: 4px solid #e2e8f0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-sizing: border-box;
}

.carga-spinner.completo .spinner-ring-border {
    border-top-color: #10B981;
    animation: none;
}

.carga-icon {
    font-size: 28px;
    color: #3498db;
    z-index: 1;
    transition: all 0.3s ease;
}

.carga-spinner.completo .carga-icon i {
    color: #10B981;
}

.carga-texto {
    color: #1e293b;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    transition: color 0.3s ease;
}

.carga-texto.carga-exito {
    color: #10B981;
}

/* Inline button style for advanced toggle */
#toggleAvanzado {
    background: none;
    border: none;
    cursor: pointer;
    color: #3498db;
    font-size: 13px;
    padding: 6px 0;
    width: 100%;
    text-align: left;
    font-weight: 500;
    flex: none;
    transition: color 0.2s ease;
}

#toggleAvanzado:hover {
    color: #2980b9;
    transform: none;
    box-shadow: none;
}

/* Range slider styling */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}


