/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Contenedor principal */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Contenido principal */
.content {
    padding: 40px;
}

/* Sección de dibujo */
.drawing-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.canvas-wrapper {
    text-align: center;
}

.canvas-container {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.canvas-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#canvas {
    border: 2px solid #3498db;
    border-radius: 10px;
    cursor: crosshair;
}

/* Sección de preview */
.preview-section {
    display: none;
    text-align: center;
}

.preview-container {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#previewCanvas {
    border: 2px solid #b3b3b3;
    border-radius: 8px;
    background: white;
}

.canvas-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Controles */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-clear {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.btn-predict {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-predict:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Sección de estado */
.status-section {
    text-align: center;
    padding: 15px;
    font-weight: 600;
}

.status-section.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-section.ready {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-section.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Sección de predicción */
.prediction-section {
    margin-top: 40px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 2px;
}

/* Grid de modelos */
.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Tarjetas de modelo */
.model-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Encabezado del modelo */
.model-header {
    text-align: center;
    margin-bottom: 30px;
}

.model-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.model-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.5;
}

/* Display de predicción */
.prediction-display {
    text-align: center;
    margin-top: 20px;
}

.prediction-number {
    font-size: 4rem;
    font-weight: 900;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.prediction-number.animate {
    transform: scale(1.1);
    color: #3498db;
}

/* Barra de confianza */
.confidence-bar-container {
    margin-top: 20px;
}

.confidence-label {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 12px;
    font-weight: 600;
}

.confidence-bar {
    width: 100%;
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
}

/* Estados del modelo */
.model-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.status-loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-ready {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animaciones */
@keyframes shimmer {
    0% {
    transform: translateX(-100%);
    }

    100% {
    transform: translateX(100%);
    }
}

@keyframes spin {
    0% {
    transform: rotate(0deg);
    }

    100% {
    transform: rotate(360deg);
    }
}

.confidence-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Sección de autor */
.author-section {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 30px 40px;
    text-align: center;
    margin-top: 40px;
}

.author-section .author-content {
    max-width: 650px;
    margin: 0 auto;
}

.author-section .author-title {
    font-size: 1.3rem;
    color: #bdc3c7;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.author-section .author-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #bda7ff;
    margin-bottom: 15px;
}

.author-section .tech-stack {
    font-size: 0.9rem;
    opacity: 0.75;
    font-style: italic;
}

/* Media Queries */
@media (max-width: 1200px) {
    .models-grid {
    grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header h1 {
    font-size: 2rem;
    }

    .content {
    padding: 20px;
    }

    .drawing-section {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    }

    .controls {
    flex-direction: column;
    gap: 15px;
    align-items: center;
    }

    .btn {
    padding: 12px 25px;
    min-width: 180px;
    width: 180px;
    }

    .models-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    }

    .prediction-number {
    font-size: 3.5rem;
    }

    .author-section {
    padding: 25px 20px;
    }

    .author-section .author-name {
    font-size: 1.3rem;
    }
}
