/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #D2D8A8 0%, #B8C095 50%, #9BA87A 100%);
    min-height: 100vh;
    color: #2F3E46;
    line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
}

.app-title i {
    color: #7A8C5A;
}

/* ===== BOTÓN DE COMPRA ===== */
.buy-kit-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    font-weight: 700;
    text-decoration: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.buy-kit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #E55A2B 0%, #E68A1A 100%);
}

.buy-kit-btn:active {
    transform: translateY(-1px);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    }
}

.github-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.github-link:hover {
    color: #7A8C5A;
    background: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.app-main {
    flex: 1;
    padding: 2rem 0;
}

/* ===== SECCIONES ===== */
.status-section,
.controls-section,
.output-section {
    margin-bottom: 2rem;
}

.status-card,
.controls-card,
.output-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.status-card:hover,
.controls-card:hover,
.output-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===== ESTADOS ===== */
.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-text i {
    color: #7A8C5A;
    margin-right: 0.5rem;
}

/* ===== TÍTULOS DE SECCIÓN ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.section-title i {
    color: #7A8C5A;
    margin-right: 0.5rem;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.form-label i {
    color: #7A8C5A;
    margin-right: 0.5rem;
}

.form-control {
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    border-color: #7A8C5A;
    box-shadow: 0 0 0 3px rgba(122, 140, 90, 0.1);
    outline: none;
}

.form-range {
    height: 8px;
    border-radius: 4px;
    background: #e1e8ed;
    outline: none;
    -webkit-appearance: none;
    border: 2px solid #7A8C5A;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7A8C5A;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid #ffffff;
}

.form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7A8C5A;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.value-display {
    font-weight: 700;
    color: #7A8C5A;
    background: rgba(122, 140, 90, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* ===== BOTONES ===== */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, #7A8C5A 0%, #6B7A4A 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 140, 90, 0.3);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #9BA87A 0%, #8A9A6A 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 168, 122, 0.3);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: #7A8C5A;
    border: 2px solid #7A8C5A;
}

.btn-outline-primary:hover {
    background: #7A8C5A;
    color: white;
    transform: translateY(-2px);
}

.btn-upload {
    position: relative;
    overflow: hidden;
}

.btn-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* ===== CANVAS ===== */
.canvas-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #e1e8ed;
}

.canvas-medium {
    max-width: 500px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.canvas-large {
    max-width: 800px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.canvas-instructions {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(122, 140, 90, 0.1);
    border-radius: 8px;
}

/* ===== ÁREA DE PINES ===== */
.pins-container {
    margin: 1.5rem 0;
}

.pins-textarea {
    width: 100%;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.8);
}

.pins-textarea:focus {
    border-color: #7A8C5A;
    box-shadow: 0 0 0 3px rgba(122, 140, 90, 0.1);
    outline: none;
}

/* ===== EJEMPLOS ===== */
.examples-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(122, 140, 90, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(122, 140, 90, 0.1);
}

.examples-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.examples-title i {
    color: #7A8C5A;
    margin-right: 0.5rem;
}

.examples-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.examples-info {
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.examples-info i {
    color: #7A8C5A;
    margin-right: 0.5rem;
}

/* ===== ACCIONES DE PINES ===== */
.pins-actions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(122, 140, 90, 0.1);
}

.pins-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.pins-info i {
    color: #667eea;
    margin-right: 0.5rem;
}

/* ===== NAVEGACIÓN DE PASOS ===== */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

.step-indicator {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.draw-status {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(86, 171, 47, 0.1);
    border-radius: 8px;
}

/* ===== ESTADOS OCULTOS ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-title {
        font-size: 1.5rem;
    }
    
    .buy-kit-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
        margin-top: 1rem;
    }
    
    .status-card,
    .controls-card,
    .output-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .examples-buttons {
        flex-direction: column;
    }
    
    .step-navigation {
        flex-direction: column;
    }
    
    .canvas-medium,
    .canvas-large {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .app-main {
        padding: 1rem 0;
    }
    
    .status-card,
    .controls-card,
    .output-card {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-card {
    animation: fadeIn 0.5s ease-out;
}

/* ===== ESTADOS DE CARGA ===== */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #7A8C5A;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
.btn:focus,
.form-control:focus,
.form-range:focus {
    outline: 2px solid #7A8C5A;
    outline-offset: 2px;
}

/* ===== ESTADOS DESHABILITADOS ===== */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ===== CONTROLES DE VOZ ===== */
.voice-controls {
    background: rgba(122, 140, 90, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(122, 140, 90, 0.1);
}

.voice-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ===== CARRUSEL DE PINES ===== */
.pin-carousel {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid rgba(122, 140, 90, 0.2);
}

.pin-carousel-display {
    text-align: center;
    padding: 1rem;
}

.pin-carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pin-item {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 60px;
    text-align: center;
}

.pin-item.prev-pin {
    font-size: 1.5rem;
    color: #95a5a6;
    background: rgba(149, 165, 166, 0.1);
    opacity: 0.7;
}

.pin-item.current-pin {
    font-size: 3rem;
    color: #7A8C5A;
    background: rgba(122, 140, 90, 0.1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(122, 140, 90, 0.3);
}

.pin-item.next-pin {
    font-size: 1.5rem;
    color: #95a5a6;
    background: rgba(149, 165, 166, 0.1);
    opacity: 0.7;
}

.pin-item.current-pin.active {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.pin-info {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* Mejoras para el carrusel - hacer más claro qué representa cada número */
.pin-carousel-container {
    position: relative;
}

/* Tooltips para cada tipo de pin */
.pin-item.prev-pin::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: #999;
    white-space: nowrap;
}

.pin-item.current-pin::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: #999;
    white-space: nowrap;
}

.pin-item.next-pin::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: #999;
    white-space: nowrap;
}

/* Estilo especial para cuando mostramos "Inicio" */
.pin-item[data-text="Inicio"] {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    border-color: #4caf50 !important;
    font-size: 0.9rem !important;
    font-weight: 600;
}

/* ===== ANIMACIONES PARA EL CARRUSEL ===== */
@keyframes pinHighlight {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.1); }
}

.pin-item.current-pin.highlight {
    animation: pinHighlight 0.5s ease-in-out;
}