/* Estilos espec�ficos para el tutorial de CSS */
/* Tema azul para dise�o web */

.tutorial-article {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

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

.article-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 2px;
}

.article-title {
    font-size: 3rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.article-subtitle {
    font-size: 1.4rem;
    color: #64748b;
    font-weight: 300;
    margin-bottom: 2rem;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: #475569;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.stat i {
    color: #3498db;
    font-size: 1.2rem;
}

.content-section {
    margin-bottom: 4rem;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.content-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.content-section h2 {
    font-size: 2.2rem;
    color: #1e293b;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: #3498db;
}

.css-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.demo-box {
    flex: 1;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.demo-box.before {
    border: 2px dashed #94a3b8;
}

.demo-box.after {
    border: 2px solid #3498db;
    position: relative;
    overflow: hidden;
}

.demo-box.after::before {
    content: 'CON CSS';
    position: absolute;
    top: 10px;
    right: -30px;
    background: #3498db;
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: bold;
}

.demo-box h3 {
    color: #475569;
    margin-bottom: 1rem;
}

.demo-content h4 {
    font-size: 1.5rem;
    margin: 1rem 0;
}

.demo-content button {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#css-demo-original .demo-content button {
    background: #cbd5e1;
    color: #475569;
}

#css-demo-styled .demo-content button {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

#css-demo-styled .demo-content h4 {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2rem;
}

.demo-arrow {
    font-size: 2.5rem;
    color: #3498db;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sintaxis */
.syntax-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.syntax-visual {
    background: #1e293b;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(30, 41, 59, 0.3);
}

.selector-example {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e2e8f0;
}

.selector {
    color: #f87171;
}

.braces {
    color: #94a3b8;
}

.property {
    color: #60a5fa;
    margin-left: 2rem;
}

.colon {
    color: #94a3b8;
    margin: 0 0.5rem;
}

.value {
    color: #34d399;
}

.semicolon {
    color: #94a3b8;
}

.syntax-explanation {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.explanation-label {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.selector-label { background: #fee2e2; color: #dc2626; }
.property-label { background: #dbeafe; color: #1d4ed8; }
.value-label { background: #dcfce7; color: #16a34a; }

/* Selectores */
.selectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.selector-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.selector-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.1);
}

.selector-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.5rem;
}

.selector-card h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.selector-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.selector-card code {
    display: block;
    background: #f1f5f9;
    padding: 0.8rem;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 1rem;
    color: #334155;
}

.try-selector {
    width: 100%;
    padding: 0.8rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.try-selector:hover {
    background: #2980b9;
}

.selector-demo-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.demo-html pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0;
}

.demo-result {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#demo-container {
    margin-top: 1rem;
}

#demo-container h1.titulo {
    margin: 0 0 1rem 0;
}

#demo-container p.destacado {
    background: #fef3c7;
    padding: 0.5rem;
    border-radius: 4px;
}

#demo-container a {
    display: inline-block;
    margin-top: 1rem;
    color: #3498db;
    text-decoration: none;
}

#demo-container input {
    margin-top: 1rem;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 100%;
}

/* Propiedades - Tabs */
.properties-tabs {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.tab-buttons {
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    overflow-x: auto;
    padding: 0.5rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    margin: 0.25rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e2e8f0;
    color: #3498db;
}

.tab-btn.active {
    color: #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-content {
    padding: 2rem;
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Controles de Propiedades */
.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-weight: 500;
}

.control-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.control-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
}

.demo-preview {
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.css-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-family: monospace;
    overflow-x: auto;
}

/* Modelo de Caja */
.box-model-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.box-visual {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.margin-box {
    position: absolute;
    border: 2px dashed #f87171;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.border-box {
    border: 2px solid #fbbf24;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.padding-box {
    border: 2px dotted #34d399;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-box {
    width: 100px;
    height: 100px;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.box-label {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
}

.margin-box .box-label { top: -10px; left: 10px; color: #dc2626; }
.border-box .box-label { top: -10px; left: 10px; color: #d97706; }
.padding-box .box-label { top: -10px; left: 10px; color: #059669; }
.content-box .box-label { color: white; }

.box-controls .control {
    margin-bottom: 1.5rem;
}

/* Responsive Design */
.responsive-demo {
    border-radius: 10px;
    padding: 2rem;
}

.device-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.device-btn {
    padding: 1rem 2rem;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    transition: all 0.3s ease;
}

.device-btn:hover {
    background: #cbd5e1;
}

.device-btn.active {
    background: #3498db;
    color: white;
}

.device-viewport {
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.viewport-content {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.responsive-box {
    flex: 1;
    background: #3498db;
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.media-query-code pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Animaciones */
.animations-demo {
    text-align: center;
}

.animation-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.anim-btn {
    padding: 1rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.anim-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.animation-area {
    height: 200px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.animated-box {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
}

/* M�todos de Aplicaci�n */
.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.method-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.method-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.1);
}

.method-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.8rem;
}

.method-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.method-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.method-card code {
    display: block;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 1.5rem;
    color: #334155;
}

.pros-cons h4 {
    color: #475569;
    margin-bottom: 0.5rem;
}

.pros-cons ul {
    list-style: none;
    padding-left: 0;
}

.pros-cons li {
    padding: 0.3rem 0;
    color: #64748b;
    position: relative;
    padding-left: 1.5rem;
}

.pros-cons li::before {
    content: '?';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Herramientas */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: #3498db;
    transform: translateY(-3px);
}

.tool-card h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-card ul {
    list-style: none;
    padding-left: 0;
}

.tool-card li {
    padding: 0.5rem 0;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.tool-card li:last-child {
    border-bottom: none;
}

.tool-card strong {
    color: #3498db;
}

/* �rea de Pr�ctica */
.practice-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

#css-editor {
    width: 100%;
    height: 300px;
    padding: 1rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
    background: #1e293b;
    color: #e2e8f0;
}

#apply-css, #reset-practice {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

#apply-css {
    background: #3498db;
    color: white;
}

#apply-css:hover {
    background: #2980b9;
}

#reset-practice {
    background: #e2e8f0;
    color: #475569;
}

#reset-practice:hover {
    background: #cbd5e1;
}

.practice-container {
    height: 300px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
}

#practice-box {
    transition: all 0.3s ease;
}

/* Consejos */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip {
    background: linear-gradient(135deg, #313131 0%, #19191a 100%);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.tip:hover {
    transform: translateY(-5px);
}

.tip i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.tip h3 {
    color: #bbbbbb;
    margin-bottom: 0.5rem;
}

.tip p {
    color: #a6c1e6;
    margin: 0;
}
