/* Estilos espec�ficos para la p�gina de Flutter ListView.Builder */

.tutorial-article {
    max-width: 1100px;
    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: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 300;
}

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

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3498db;
    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: #2980b9;
    transform: translateY(-2px);
}

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

.content-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Overview de ListView.Builder */
.listview-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
    align-items: start;
}

.performance-comparison {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    border-radius: 8px;
}

.comparison-item {
    flex: 1;
    text-align: center;
}

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

.comparison-icon.inefficient {
    color: #e74c3c;
}

.comparison-icon.efficient {
    color: #27ae60;
}

.comparison-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.comparison-item ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.comparison-item li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-size: 0.9rem;
}

.comparison-arrow {
    font-size: 2rem;
    color: #3498db;
    font-weight: bold;
}

.overview-text h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.overview-text ul {
    margin: 0;
    padding-left: 1.5rem;
}

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

/* Escenarios de uso */
.usage-scenarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.scenario {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
}

.scenario-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.scenario h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Propiedades */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.property-item {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.property-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-family: monospace;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.property-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.property-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Ejemplos Visuales */
.visual-examples {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.example-item {
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.phone-mockup {
    width: 300px;
    background: #2c3e50;
    border-radius: 20px;
    padding: 15px;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.phone-screen {
    border-radius: 10px;
    height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.listview-demo, .horizontal-list-demo {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #3498db;
    color: white;
    padding: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.app-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.list-content, .horizontal-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.list-item:nth-child(even) {
}

.item-number {
    width: 30px;
    height: 30px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.item-subtitle {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.item-check {
    color: #27ae60;
    font-size: 1.2rem;
    opacity: 0.7;
}

.list-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.control-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: #2980b9;
}

/* Lista Horizontal */
.horizontal-list-content {
    display: flex;
    overflow-x: auto;
    padding: 16px;
    gap: 16px;
}

.horizontal-item {
    flex: 0 0 auto;
    width: 120px;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #ecf0f1;
}

.product-image {
    font-size: 2rem;
    margin-bottom: 8px;
}

.product-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.product-price {
    color: #27ae60;
    font-weight: bold;
    font-size: 1rem;
}

/* Demo Interactivo */
.interactive-demo {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.demo-controls {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#itemCountValue, #itemHeightValue, #paddingValue {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.demo-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.demo-button:hover {
    background: #2980b9;
}

.demo-button.secondary {
    background: #95a5a6;
}

.demo-button.secondary:hover {
    background: #7f8c8d;
}

.demo-preview {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.phone-mockup-preview {
    width: 320px;
    background: #2c3e50;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.phone-screen-preview {
    border-radius: 10px;
    height: 400px;
    overflow: hidden;
}

.listview-preview {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    flex-shrink: 0;
}

.preview-header h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
}

#previewStatus {
    margin: 0;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.preview-list {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* Items del preview */
.preview-item {
    padding: 12px 16px;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.preview-item:hover {
}

.preview-item.basic {
    display: flex;
    align-items: center;
}

.preview-item.cards {
    margin: 8px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.preview-item.alternating:nth-child(even) {
}

.preview-item.custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.preview-item.custom::before {
    content: '??';
    font-size: 1.2rem;
}

.preview-item.horizontal {
    display: inline-block;
    width: 120px;
    margin: 8px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    vertical-align: top;
}

.item-index {
    width: 24px;
    height: 24px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.item-text {
    flex: 1;
}

.preview-code {
    width: 100%;
    max-width: 600px;
}

.code-output {
    background: #2c3e50;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Mejores Pr�cticas, Ejercicios, etc. */
.best-practices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.practice {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.practice h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.practice ul {
    margin: 0;
    padding-left: 1.5rem;
}

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

.pro-tip {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #e17055;
}

.pro-tip h4 {
    color: #2d3436;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercises {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.exercise {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exercise h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.exercise-hint {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.troubleshooting-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.problem {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.problem h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-solution {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

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

.resource {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
}

.resource h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.resource-link {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.resource-link:hover {
    background: #2980b9;
}

/* C�digo */
.code-example {
    margin: 2rem 0;
}

.code-example h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

pre {
    background: #2c3e50;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    color: #e74c3c;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

pre code {
    background: none;
    color: #462f9f;
    padding: 0;
}

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

.content-section {
    animation: fadeIn 0.6s ease-out;
}

/* Scroll personalizado */
.preview-list::-webkit-scrollbar {
    width: 6px;
}

.preview-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.preview-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.preview-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
