/**
 * Estilos del Generador Oficial de Carnets de Guía - ACGP
 * Associació Catalana de Guies de Pesca
 */

/* 1. BOTÓN DE ACCESO EN CABECERA Y MENÚ */
.acgp-admin-carnet-item {
    display: inline-flex;
    align-items: center;
}

.acgp-carnet-nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, rgba(2, 128, 144, 0.15) 0%, rgba(0, 168, 150, 0.2) 100%) !important;
    border: 1px solid rgba(0, 168, 150, 0.5) !important;
    color: #00a896 !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
}

.acgp-carnet-nav-btn:hover {
    background: linear-gradient(135deg, #028090 0%, #00a896 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(0, 168, 150, 0.35) !important;
    transform: translateY(-1px) !important;
}

.acgp-carnet-badge {
    background: #061829;
    color: #f4a261;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* 2. MODAL WRAPPER Y BACKDROP */
.acgp-carnet-modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.acgp-carnet-modal-wrap.active {
    opacity: 1;
    visibility: visible;
}

.acgp-carnet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 24, 41, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 3. DIALOG CONTENEDOR */
.acgp-carnet-dialog {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.acgp-carnet-modal-wrap.active .acgp-carnet-dialog {
    transform: scale(1) translateY(0);
}

/* 4. CABECERA DEL MODAL */
.acgp-carnet-header {
    background: linear-gradient(135deg, #061829 0%, #0a2540 100%);
    color: #ffffff;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #00a896;
}

.acgp-carnet-badge-admin {
    display: inline-block;
    background: rgba(0, 168, 150, 0.25);
    color: #64dfdf;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    border: 1px solid rgba(100, 223, 223, 0.3);
}

.acgp-carnet-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}

.acgp-carnet-desc {
    margin: 0;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.4;
}

.acgp-carnet-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.acgp-carnet-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

/* 5. CUERPO DEL MODAL (2 COLUMNAS) */
.acgp-carnet-body {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 24px;
    padding: 24px 28px;
    overflow-y: auto;
    background: #f8fafc;
}

/* COLUMNA 1: FORMULARIO */
.acgp-carnet-col-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.acgp-carnet-label {
    display: block;
    font-size: 14px;
    color: #0a2540;
    margin-bottom: 6px;
}

.acgp-carnet-select-wrap {
    position: relative;
}

.acgp-carnet-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #00a896;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #061829;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.acgp-carnet-select:focus {
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.25);
}

.acgp-carnet-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.acgp-carnet-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acgp-carnet-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.acgp-carnet-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.acgp-carnet-field-full {
    grid-column: span 2;
}

.acgp-carnet-field label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.acgp-carnet-field input[type="text"],
.acgp-carnet-field input[type="number"],
.acgp-carnet-field select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.acgp-carnet-field input:focus,
.acgp-carnet-field select:focus {
    border-color: #00a896;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 168, 150, 0.2);
}

/* OPCIONES DE FORMATO PDF */
.acgp-carnet-format-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.acgp-carnet-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.acgp-carnet-radio-card:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.acgp-carnet-radio-card.active {
    border-color: #00a896;
    background: #f0fdf4;
    box-shadow: 0 2px 6px rgba(0, 168, 150, 0.12);
}

.acgp-carnet-radio-card input[type="radio"] {
    margin-top: 3px;
    accent-color: #00a896;
}

.acgp-radio-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.acgp-radio-title {
    font-size: 13px;
    font-weight: 700;
    color: #0a2540;
}

.acgp-radio-sub {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.3;
}

/* COLUMNA 2: PREVIEW Y ACCIONES */
.acgp-carnet-col-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.acgp-carnet-preview-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.acgp-carnet-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.acgp-preview-label {
    font-size: 11.5px;
    font-weight: 800;
    color: #028090;
    letter-spacing: 0.5px;
}

.acgp-preview-dims {
    font-size: 11px;
    color: #94a3b8;
}

/* CANVAS DE DIBUJO */
.acgp-canvas-container {
    background: #0b1320;
    padding: 16px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

#acgp-carnet-canvas {
    width: 100%;
    max-width: 540px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: block;
    background: #ffffff;
}

.acgp-canvas-sides-indicator {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 540px;
    margin-top: 10px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.acgp-side-front {
    color: #64dfdf;
}

.acgp-side-split {
    color: #475569;
}

.acgp-side-back {
    color: #f4a261;
}

/* RESUMEN DEL GUÍA */
.acgp-carnet-guide-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.acgp-summary-avatar-wrap img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #00a896;
}

.acgp-summary-details strong {
    display: block;
    font-size: 14px;
    color: #0a2540;
    margin-bottom: 4px;
}

.acgp-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.acgp-summary-pills span {
    font-size: 11px;
    background: #e2e8f0;
    color: #334155;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

/* BOTONES DE ACCIÓN */
.acgp-carnet-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acgp-action-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.acgp-btn-download-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #028090 0%, #00a896 100%);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 168, 150, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.acgp-btn-download-pdf:hover {
    background: linear-gradient(135deg, #026c7a 0%, #009383 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 150, 0.45);
}

.acgp-btn-download-pdf:active {
    transform: translateY(0);
}

.acgp-carnet-actions-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.acgp-btn-download-png,
.acgp-btn-print {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #0a2540;
    border: 1.5px solid #cbd5e1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.acgp-btn-download-png:hover,
.acgp-btn-print:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #00a896;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .acgp-carnet-body {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .acgp-carnet-form-grid {
        grid-template-columns: 1fr;
    }

    .acgp-carnet-field-full {
        grid-column: span 1;
    }

    .acgp-carnet-actions-secondary {
        grid-template-columns: 1fr;
    }
}

/* ESTILOS DE LOS MODOS DE DISEÑO (AUTOGENERADO VS CLÁSICO) */
.acgp-carnet-design-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 640px) {
    .acgp-carnet-design-modes {
        grid-template-columns: 1fr;
    }
}
.acgp-carnet-mode-card {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.acgp-carnet-mode-card:hover {
    border-color: #00a896 !important;
    background: #f8fafc;
}
.acgp-carnet-mode-card.active {
    border-color: #00a896 !important;
    background: #f0fdfa !important;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.12);
}

/* ESTILOS DE IMPRESIÓN DIRECTA */
@media print {
    body * {
        visibility: hidden !important;
    }
    #acgp-carnet-canvas,
    #acgp-carnet-canvas * {
        visibility: visible !important;
    }
    #acgp-carnet-canvas {
        position: fixed !important;
        left: 50% !important;
        top: 30% !important;
        transform: translate(-50%, -50%) !important;
        width: 171.2mm !important;
        height: 54mm !important;
        box-shadow: none !important;
    }
}
