﻿/* Estilos específicos para la página Crear API FacturaScripts */
/* Tema azul/verde para APIs y Flutter */

.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: #0288d1; /* Azul Flutter */
    margin-bottom: 1rem;
    font-weight: 300;
}

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

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

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

.content-section h3 {
    color: #01579b; /* Azul oscuro */
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
}

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

.content-section h5 {
    color: #01579b;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 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: #e3f2fd; /* Azul muy claro */
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #0288d1;
}

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

/* Estilos para listas */
.content-section ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

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

.content-section code {
    background: #e3f2fd;
    color: #01579b;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Estilos para código */
.code-block {
    display: inline-block;
    background: #e3f2fd;
    color: #01579b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
}

.code-example {
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-example h4, .code-example h5 {
    color: #0288d1;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: -0.5rem -0.5rem 1rem -0.5rem;
}

.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;
}

/* Estilos para formulario en vivo */
.live-example {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    padding: 2rem;
    border-radius: 8px;
    border: 2px dashed #0288d1;
    margin: 2rem 0;
}

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

.form-container h3 {
    text-align: center;
    color: #0288d1;
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: #e3f2fd;
    border-color: #0288d1;
    transform: translateX(5px);
}

.radio-text {
    font-weight: normal;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #0288d1 0%, #26c6da 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

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

/* Grid para tipos de funciones */
.functions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.function-type {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #0288d1;
}

.function-type h3 {
    color: #0288d1;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Grid para ejercicios */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 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: #0288d1;
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.1);
    transform: translateY(-3px);
}

.exercise h3 {
    color: #0288d1;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Estilos para sección de problemas */
.troubleshooting {
    background: linear-gradient(135deg, #fff3e0 0%, #e3f2fd 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;
}

/* Estilos para caja extensible */
.expandable-box {
    margin-top: 1rem;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    overflow: hidden;
}

.expand-button {
    width: 100%;
    background: #0288d1;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.expand-button:hover {
    background: #01579b;
}

.arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-content.expanded {
    max-height: 2000px;
}

.expandable-content-inner {
    padding: 1.5rem;
}

/* Cuando la caja está expandida */
.expandable-box.expanded .arrow {
    transform: rotate(180deg);
}

.expandable-box.expanded .expand-button {
    background: #01579b;
}

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

.content-section a:hover {
    color: #01579b;
    text-decoration: underline;
}

/* Mensaje de redirección */
.redirect-message {
    background: #e3f2fd;
    border: 2px solid #0288d1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.redirect-message h3 {
    color: #0288d1;
    margin-bottom: 1rem;
}

.redirect-message a {
    color: #0288d1;
    text-decoration: none;
    font-weight: bold;
}

.redirect-message a:hover {
    text-decoration: underline;
}

/* Resaltado de sintaxis Dart/Flutter - DESACTIVADO
   Para evitar conflictos con el HTML escapado desde PHP
   El código se muestra en color oscuro sobre fondo claro para mejor legibilidad
*/

/* Botón para copiar código */
.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0288d1;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s;
}

.copy-code-btn:hover {
    background: #01579b;
}

.code-example {
    position: relative;
}

/* Asegurar que el pre conserve los espacios */
.code-example pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.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 informativos */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.25rem;
}

.badge-get {
    background: #4caf50;
    color: white;
}

.badge-post {
    background: #ff9800;
    color: white;
}

.badge-put {
    background: #2196f3;
    color: white;
}

.badge-delete {
    background: #f44336;
    color: white;
}

.badge-async {
    background: #9c27b0;
    color: white;
}

/* Destacar secciones importantes */
.highlight-section {
    background: linear-gradient(135deg, #fff3e0 0%, #fffde7 100%);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin: 1.5rem 0;
}

.highlight-section h3 {
    color: #f57c00;
    margin-top: 0;
}

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

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

/* Scrollbar personalizado para code blocks */
.code-example::-webkit-scrollbar {
    height: 8px;
}

.code-example::-webkit-scrollbar-track {
    background: #e1e8ed;
    border-radius: 4px;
}

.code-example::-webkit-scrollbar-thumb {
    background: #0288d1;
    border-radius: 4px;
}

.code-example::-webkit-scrollbar-thumb:hover {
    background: #01579b;
}

/* Responsive */
@media (max-width: 768px) {
    .tutorial-article {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .exercises-grid,
    .problems-grid,
    .functions-grid {
        grid-template-columns: 1fr;
    }
    
    .code-example {
        font-size: 0.8rem;
    }
}

/* Efectos hover para mejorar UX */
.step:hover {
    background: #bbdefb;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Iconos de método HTTP */
.http-method {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.http-method-get { color: #4caf50; }
.http-method-post { color: #ff9800; }
.http-method-put { color: #2196f3; }
.http-method-delete { color: #f44336; }

/* Tabla de endpoints */
.endpoints-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.endpoints-table th {
    background: #0288d1;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.endpoints-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e1e8ed;
}

.endpoints-table tr:hover {
    background: #e3f2fd;
}

/* Sección de scroll suave */
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;
    }
}
