/* Estilos específicos para la página de Flutter TextField */

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

.content-section h3 {
    color: #34495e;
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
}

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

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

/* Overview de TextField */
.textfield-overview {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin: 2rem 0;
    align-items: start;
}

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

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

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-example {
    padding: 2rem;
    flex: 1;
}

.textfield-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.textfield {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

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

.textfield i {
    color: #7f8c8d;
    margin-right: 0.5rem;
}

.textfield input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
}

.textfield input::placeholder {
    color: #bdc3c7;
}

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

/* 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;
}

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

.property-details {
    margin-top: 1rem;
}

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

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

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

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

.visual-preview {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
}

.textfield-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.textfield-preview label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.textfield-preview .field {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 20px;
}

.textfield-preview .field.hint {
    color: #bdc3c7;
    font-style: italic;
}

.textfield-preview .field.with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.textfield-preview.error .field {
    border-color: #e74c3c;
}

.textfield-preview .error-text {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.25rem;
}

/* Tipos de TextField */
.textfield-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

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

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

.type-visual {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
}

.textfield-example {
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
}

.textfield-example.basic {
    border-bottom: 1px solid #ddd;
}

.textfield-example.basic input {
    border: none;
    padding: 0.75rem;
    outline: none;
    flex: 1;
}

.textfield-example.outline {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.textfield-example.outline input {
    border: none;
    padding: 0.75rem;
    outline: none;
    flex: 1;
}

.textfield-example.with-icon {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 0.75rem;
}

.textfield-example.with-icon i {
    color: #7f8c8d;
    margin-right: 0.5rem;
}

.textfield-example.with-icon input {
    border: none;
    padding: 0.75rem 0;
    outline: none;
    flex: 1;
}

.textfield-example.password {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 0.75rem;
}

.textfield-example.password i {
    color: #7f8c8d;
}

.textfield-example.password input {
    border: none;
    padding: 0.75rem;
    outline: none;
    flex: 1;
    letter-spacing: 2px;
}

.textfield-example.multiline textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.textfield-example.error input {
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 0.75rem;
    outline: none;
    flex: 1;
    color: #e74c3c;
}

.textfield-example .error-message {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.25rem;
}

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

/* Gestión de estado */
.state-management {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.state-approach {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

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

/* Tipos de teclado */
.keyboard-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.keyboard-item {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

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

.keyboard-visual {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
}

.keyboard {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
}

/* Demo interactivo */
.interactive-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 8px;
}

.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

.preview-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.phone-mockup-preview {
    width: 300px;
    background: #2c3e50;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    margin: 0 auto;
}

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

.form-preview {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.textfield-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-textfield {
    width: 100%;
    max-width: 300px;
}

.preview-info {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
}

.live-text {
    font-size: 0.9rem;
    color: #2c3e50;
}

#currentText {
    font-weight: 600;
    color: #3498db;
}

.preview-code {
    background: #2c3e50;
    border-radius: 6px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.code-output code {
    color: #ecf0f1;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Validación */
.validation-examples {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.validation-item {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

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

/* Mejores prácticas */
.troubleshooting {
    background: #fffaf0;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
}

.best-practices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.practice h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

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

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

.pro-tip {
    background: #e1f5fe;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #0288d1;
}

.pro-tip h4 {
    color: #0288d1;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ejercicios */
.exercises {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exercise {
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

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

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

.exercise-hint p {
    margin: 0;
    font-style: italic;
}

/* Solución de problemas */
.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.problem h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

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

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

.code-example h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.code-example code {
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    line-height: 1.5;
}
