﻿/* Estilos para Sistema de Registro y Login - Flutter + FacturaScripts */
/* Tema morado/verde para seguridad y autenticación */

.tutorial-article {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
}

.article-title {
    font-size: 2.5rem;
    color: #9c27b0; /* Morado para seguridad */
    margin-bottom: 1rem;
    font-weight: 300;
}

.article-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    color: #9c27b0;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.content-section h3 {
    color: #7b1fa2; /* Morado oscuro */
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
}

.content-section h4 {
    color: #9c27b0;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem 0;
}

.content-section p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #555;
}

/* Estilos para pasos */
.steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    background: #f3e5f5; /* Morado muy claro */
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #9c27b0;
    transition: all 0.3s ease;
}

.step:hover {
    background: #e1bee7;
    transform: translateX(5px);
}

.step h3 {
    color: #2c3e50;
    margin-top: 0;
}

.step ol, .step ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.step li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Código inline */
.content-section code {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Bloques de código */
.code-example {
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-example code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #2c3e50;
    line-height: 1.6;
    display: block;
    font-size: 0.9rem;
    tab-size: 4;
    background: transparent;
    padding: 0;
}

/* Grid de componentes con cards */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.component-card {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1f5fe 100%);
    padding: 2rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #9c27b0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(156, 39, 176, 0.2), transparent);
    transition: left 0.5s;
}

.component-card:hover::before {
    left: 100%;
}

.component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(156, 39, 176, 0.3);
    border-color: #7b1fa2;
}

.component-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.component-card h3 {
    color: #9c27b0;
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.component-card p {
    color: #7f8c8d;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.view-code {
    display: inline-block;
    margin-top: 1rem;
    color: #9c27b0;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Grid para ejercicios */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.exercise {
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.exercise:hover {
    border-color: #9c27b0;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.15);
    transform: translateY(-3px);
}

.exercise h3 {
    color: #9c27b0;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sección de problemas */
.troubleshooting {
    background: linear-gradient(135deg, #fff3e0 0%, #f3e5f5 100%);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.troubleshooting h2 {
    color: #ff9800;
}

.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.problem {
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.problem:hover {
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.problem h3 {
    color: #ff9800;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Caja resaltada */
.highlight-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #f3e5f5 100%);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.highlight-box h2 {
    color: #4caf50;
}

/* Flujo de conexión */
.connection-flow {
    margin: 2rem 0;
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.flow-number {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(156, 39, 176, 0.3);
}

.flow-content {
    flex: 1;
}

.flow-content h4 {
    color: #9c27b0;
    margin: 0 0 0.5rem 0;
}

.flow-content p {
    margin: 0.5rem 0;
    color: #555;
}

.flow-content code {
    display: block;
    margin-top: 0.5rem;
    background: #f3e5f5;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.flow-arrow {
    text-align: center;
    font-size: 2rem;
    color: #9c27b0;
    margin: -0.5rem 0;
}

/* ESTILOS PARA MODALES */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

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

.modal-content h2 {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 1.5rem 2rem;
    margin: 0;
    border-radius: 12px 12px 0 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content .code-example {
    margin: 1.5rem 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.modal-explanation {
    background: #f3e5f5;
    padding: 1.5rem 2rem;
    margin: 0 2rem 2rem 2rem;
    border-radius: 8px;
    border-left: 4px solid #9c27b0;
}

.modal-explanation h3 {
    color: #9c27b0;
    margin-top: 0;
}

.modal-explanation ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-explanation li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.close {
    color: white;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0 0.5rem;
}

.close:hover,
.close:focus {
    color: #ffeb3b;
    transform: rotate(90deg);
}

/* Scrollbar personalizado para modales */
.modal-content::-webkit-scrollbar,
.modal-content .code-example::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track,
.modal-content .code-example::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb,
.modal-content .code-example::-webkit-scrollbar-thumb {
    background: #9c27b0;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modal-content .code-example::-webkit-scrollbar-thumb:hover {
    background: #7b1fa2;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #0288d1 0%, #26c6da 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #01579b 0%, #0097a7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.3);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.25rem;
}

.badge-flutter {
    background: #02569b;
    color: white;
}

.badge-php {
    background: #777bb3;
    color: white;
}

.badge-facturascripts {
    background: #0c7cd5;
    color: white;
}

/* Links */
.content-section a {
    color: #9c27b0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.content-section a:hover {
    color: #7b1fa2;
    text-decoration: underline;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .tutorial-article {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .components-grid,
    .exercises-grid,
    .problems-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .flow-step {
        flex-direction: column;
        text-align: center;
    }
    
    .flow-number {
        margin: 0 auto;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Target section cuando se hace scroll */
section:target {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: #fff9c4;
    }
}

/* Loader para futuras funcionalidades */
.loader {
    border: 4px solid #f3e5f5;
    border-top: 4px solid #9c27b0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
