/* ========================================
   DYGO PLATFORM - CLIENTES & CONFIGURACIÓN
   UI Improvements - 2026
   ======================================== */

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========================================
   TRAFFICKER SELECT EN MODAL
   ======================================== */
.trafficker-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.trafficker-section .modal-section-title {
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trafficker-section .modal-section-title svg {
    width: 18px;
    height: 18px;
    color: #3b82f6;
}

.trafficker-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background-color: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.trafficker-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.trafficker-select:hover {
    border-color: #94a3b8;
}

/* ========================================
   GENERATE INFO SECTION
   ======================================== */
.generate-info-section {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid #10b981;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.generate-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.generate-info-title {
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.generate-info-title svg {
    width: 24px;
    height: 24px;
    color: #059669;
}

.file-input-wrapper {
    margin-bottom: 1.25rem;
}

.file-input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #047857;
    margin-bottom: 0.5rem;
}

.type-select {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #6ee7b7;
    border-radius: 8px;
    background-color: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.type-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.file-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
    border: 2px dashed #6ee7b7;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #065f46;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input:hover {
    border-color: #10b981;
    background-color: white;
}

.btn-generate-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-generate-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-generate-info:hover::before {
    left: 100%;
}

.btn-generate-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-generate-info:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.btn-generate-info svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   CONFIGURACIÓN PAGE
   ======================================== */
.config-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.user-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.user-email {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
}

.user-role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-role-badge.trafficker {
    background: #dbeafe;
    color: #1d4ed8;
}

.user-role-badge.admin {
    background: #ede9fe;
    color: #7c3aed;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: color 0.2s ease;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
}

.btn-icon.btn-danger:hover svg {
    color: #ef4444;
}

.btn-icon:not(.btn-danger):hover svg {
    color: #3b82f6;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f3f4f6;
}

/* ========================================
   ONBOARDING QUICK ACTION
   ======================================== */
.onboarding-quick-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.15);
}

.onboarding-info h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 0.25rem 0;
}

.onboarding-info p {
    font-size: 0.875rem;
    color: #b45309;
    margin: 0;
}

.btn-copy-onboarding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-copy-onboarding:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-copy-onboarding.copied {
    background: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-copy-onboarding svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   MODAL IMPROVEMENTS
   ======================================== */
.modal-content {
    max-height: 85vh;
    border-radius: 20px;
}

.modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.modal-section-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title svg {
    width: 16px;
    height: 16px;
    color: #3b82f6;
}

.modal-section-content {
    font-size: 0.9375rem;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ========================================
   STATS CARD - YELLOW
   ======================================== */
.stat-icon-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

/* ========================================
   SPINNER
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .onboarding-quick-action {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .config-section {
        padding: 1.25rem;
    }
}
