/**
 * Estilos del Sistema de Migración cPanel
 * @author MiniMax Agent
 */

/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-source: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-dest: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Spacing */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-secure {
    background: var(--success-light);
    color: var(--success);
}

.badge-secure svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ========================================
   Progress Steps
   ======================================== */
.progress-container {
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
}

.step-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-500);
}

.step-check {
    display: none;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--white);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: var(--transition);
}

.step-line {
    width: 4rem;
    height: 2px;
    background: var(--gray-200);
    transition: var(--transition);
}

/* Step States */
.step.active .step-icon {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.step.active .step-number {
    color: var(--white);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-icon {
    background: var(--gradient-success);
    border-color: var(--success);
}

.step.completed .step-number {
    display: none;
}

.step.completed .step-check {
    display: block;
}

.step.completed .step-label {
    color: var(--success);
}

.step.completed + .step-line {
    background: var(--success);
}

/* ========================================
   Form Container
   ======================================== */
.form-container {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.form-step {
    display: none;
    padding: 2.5rem;
    animation: fadeIn var(--transition-slow);
}

.form-step.active {
    display: block;
}

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

/* ========================================
   Step Header
   ======================================== */
.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-icon-large {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.step-icon-large svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--white);
}

.step-icon-large.source {
    background: var(--gradient-source);
}

.step-icon-large.destination {
    background: var(--gradient-dest);
}

.step-icon-large.analyze {
    background: var(--gradient-primary);
}

.step-icon-large.progress-icon {
    background: var(--gradient-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.step-header p {
    color: var(--gray-500);
}

/* ========================================
   Form Elements
   ======================================== */
.migration-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group label svg {
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--gray-800);
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    display: block;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--gray-600);
}

.toggle-password svg {
    width: 1.25rem;
    height: 1.25rem;
}

.toggle-password .eye-closed {
    display: none;
}

.toggle-password.active .eye-open {
    display: none;
}

.toggle-password.active .eye-closed {
    display: block;
}

/* ========================================
   Buttons
   ======================================== */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* Button Loading State */
.btn-loading {
    display: none;
}

.btn.loading .btn-text,
.btn.loading .btn-icon {
    display: none;
}

.btn.loading .btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 30 70;
    stroke-linecap: round;
}

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

/* ========================================
   Connection Status
   ======================================== */
.connection-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: none;
}

.connection-status.show {
    display: block;
    animation: fadeIn var(--transition);
}

.connection-status.success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.connection-status.error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.connection-status .status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-status svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

/* ========================================
   Analysis Results
   ======================================== */
.analysis-container {
    max-width: 600px;
    margin: 0 auto;
}

.loading-analysis {
    text-align: center;
    padding: 3rem;
}

.spinner-large {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.spinner-large circle {
    stroke-dasharray: 30 70;
    stroke-linecap: round;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    text-align: center;
}

.summary-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-card .label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ========================================
   Migration Options
   ======================================== */
.migration-options h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--gray-700);
}

.option-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.option-card {
    cursor: pointer;
}

.option-card input {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.option-card:hover .option-content {
    border-color: var(--primary-light);
    background: var(--white);
}

.option-card input:checked + .option-content {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.option-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.option-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--white);
}

.option-icon.files {
    background: var(--gradient-source);
}

.option-icon.databases {
    background: var(--gradient-primary);
}

.option-icon.emails {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.option-info {
    flex: 1;
}

.option-title {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
}

.option-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.option-check {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    transition: var(--transition);
}

.option-check svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--white);
    opacity: 0;
    transition: var(--transition);
}

.option-card input:checked + .option-content .option-check {
    background: var(--primary);
    border-color: var(--primary);
}

.option-card input:checked + .option-content .option-check svg {
    opacity: 1;
}

/* ========================================
   Migration Progress
   ======================================== */
.migration-progress-container {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 0.75rem;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 9999px;
    transition: width var(--transition-slow);
}

.progress-percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 3.5rem;
    text-align: right;
}

.migration-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.task-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-200);
}

.task-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-500);
}

.task-item.in-progress .task-icon {
    background: var(--info-light);
}

.task-item.in-progress .task-icon svg {
    color: var(--info);
    animation: spin 1s linear infinite;
}

.task-item.completed .task-icon {
    background: var(--success-light);
}

.task-item.completed .task-icon svg {
    color: var(--success);
}

.task-item.failed .task-icon {
    background: var(--danger-light);
}

.task-item.failed .task-icon svg {
    color: var(--danger);
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: var(--gray-800);
}

.task-status {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Migration Log */
.migration-log {
    background: var(--gray-900);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-800);
    color: var(--gray-300);
    font-size: 0.875rem;
    font-weight: 500;
}

.log-header svg {
    width: 1rem;
    height: 1rem;
}

.log-content {
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    line-height: 1.8;
}

.log-entry {
    color: var(--gray-400);
}

.log-entry.success {
    color: var(--success);
}

.log-entry.error {
    color: var(--danger);
}

.log-entry .timestamp {
    color: var(--gray-600);
    margin-right: 0.5rem;
}

/* Migration Complete */
.migration-complete {
    text-align: center;
    padding: 2rem;
}

.complete-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-light);
    border-radius: 50%;
}

.complete-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--success);
}

.migration-complete h3 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.migration-complete p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ========================================
   Footer
   ======================================== */
.app-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: var(--gray-400);
    font-size: 0.75rem;
}

.security-note svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem 0.5rem;
    }

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

    .progress-steps {
        padding: 1rem;
    }

    .step-line {
        width: 2rem;
    }

    .step-label {
        display: none;
    }

    .form-step {
        padding: 1.5rem;
    }

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

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .analysis-summary {
        grid-template-columns: 1fr;
    }
}
