:root {
            --primary-color: #2c3e50;
            --secondary-color: #3498db;
            --accent-color: #e74c3c;
            --light-color: #ecf0f1;
            --dark-color: #34495e;
            --success-color: #27ae60;
            --warning-color: #f39c12;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        #app {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        .screen {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            padding: 30px;
            margin-bottom: 20px;
        }

        /* Pantalla de Bienvenida */
        .welcome-screen {
            text-align: center;
            padding: 50px 30px;
        }

        .welcome-header {
            margin-bottom: 40px;
        }

        .welcome-header h3 {
            color: var(--primary-color);
            font-size: 28px;
            margin-bottom: 10px;
        }

        .welcome-header h4 {
            color: var(--secondary-color);
            font-size: 22px;
            font-weight: normal;
        }

        #enterBtn {
            background-color: var(--secondary-color);
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 18px;
            border-radius: 50px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        #enterBtn:hover {
            background-color: var(--primary-color);
        }

        /* Pantalla de Selección */
        .selection-screen {
            text-align: center;
        }

        .selection-header {
            margin-bottom: 40px;
        }

        .selection-header h1 {
            color: var(--primary-color);
            font-size: 32px;
        }

        .selection-buttons {
            display: flex;
            flex-direction: column;
            gap: 20px;
            max-width: 400px;
            margin: 0 auto;
        }

        .selection-buttons button {
            padding: 15px;
            font-size: 16px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .selection-buttons button:not(.secondary-btn) {
            background-color: var(--secondary-color);
            color: white;
        }

        .selection-buttons button:not(.secondary-btn):hover {
            background-color: var(--primary-color);
        }

        .secondary-btn {
            background-color: var(--light-color);
            color: var(--dark-color);
        }

        .secondary-btn:hover {
            background-color: #dce4e8;
        }

        /* Pantalla de Búsqueda */
        .search-screen {
            min-height: 600px;
            display: flex;
            flex-direction: column;
        }

        .search-header {
            margin-bottom: 30px;
            text-align: center;
        }

        .search-header h2 {
            color: var(--primary-color);
        }

        .search-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            margin-bottom: 30px;
        }

        #searchInput {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            margin-bottom: 20px;
        }

        .search-results {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
            max-height: 60vh;
            overflow-y: auto;
        }

        .product-card {
            border: 1px solid #e1e4e8;
            border-radius: 8px;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            animation: fadeIn 0.3s ease-out;
        }

        .product-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
        }

        .product-info h3 {
            color: var(--primary-color);
            margin-bottom: 8px;
        }

        .product-category {
            color: var(--dark-color);
            font-size: 14px;
            margin-bottom: 5px;
        }

        .product-risk {
            font-weight: bold;
            margin-bottom: 5px;
        }

        .risk-alto {
            color: var(--accent-color);
        }

        .risk-medio {
            color: var(--warning-color);
        }

        .risk-moderado {
            color: var(--warning-color);
        }

        .risk-bajo {
            color: var(--success-color);
        }

        .product-code {
            font-size: 14px;
            color: #666;
        }

        .product-actions {
            display: flex;
            gap: 10px;
        }

        .pdf-btn, .view-original-btn {
            padding: 8px 15px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: opacity 0.2s;
        }

        .pdf-btn {
            background-color: var(--secondary-color);
            color: white;
        }

        .view-original-btn {
            background-color: var(--light-color);
            color: var(--dark-color);
        }

        .pdf-btn:disabled, .view-original-btn:disabled {
            opacity: 0.7;
            cursor: not-allowed;
        }

        .no-results {
            text-align: center;
            padding: 30px;
            color: #666;
        }

        /* Pantallas de Ficha y Etiqueta de Seguridad */
        .safety-sheet-screen, .safety-label-screen {
            max-height: 80vh;
            overflow-y: auto;
        }

        .safety-sheet-header, .safety-label-header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }

        .safety-sheet-header h1, .safety-label-header h1 {
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .safety-sheet-header h2, .safety-label-header h2 {
            color: var(--dark-color);
            margin-bottom: 10px;
        }

        .cas-number {
            font-style: italic;
            color: #666;
        }

        .data-source {
            font-size: 14px;
            color: var(--success-color);
            margin-top: 10px;
        }

        .confidence-high {
            color: var(--success-color);
            font-weight: bold;
        }

        .confidence-medium {
            color: var(--warning-color);
            font-weight: bold;
        }

        .confidence-low {
            color: var(--accent-color);
            font-weight: bold;
        }

        .safety-sheet-content, .safety-label-content {
            margin-bottom: 30px;
        }

        .safety-section {
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid #f0f0f0;
        }

        .safety-section h3 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 18px;
            padding-bottom: 5px;
            border-bottom: 2px solid var(--secondary-color);
        }

        .safety-section h4 {
            color: var(--dark-color);
            margin-bottom: 10px;
            font-size: 16px;
        }

        .safety-section p {
            margin-bottom: 10px;
            line-height: 1.6;
        }

        .safety-section ul {
            padding-left: 20px;
            margin-bottom: 10px;
        }

        .safety-section li {
            margin-bottom: 5px;
        }

        /* Estilos específicos para etiquetas */
        .signal-word {
            font-size: 24px;
            font-weight: bold;
            color: var(--accent-color);
            text-align: center;
            margin: 15px 0;
            padding: 10px;
            border: 2px solid var(--accent-color);
            border-radius: 8px;
        }

        .pictograms-section {
            text-align: center;
        }

        .pictograms-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
            margin: 20px 0;
        }

        .pictogram {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 120px;
        }

        .pictogram-image-container {
            width: 80px;
            height: 80px;
            border: 2px solid #ccc;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
        }

        .pictogram img {
            max-width: 60px;
            max-height: 60px;
        }

        .hazard-statements, .precautionary-statements {
            list-style-type: none;
            padding-left: 0;
        }

        .hazard-statements li, .precautionary-statements li {
            padding: 8px 12px;
            margin-bottom: 8px;
            border-radius: 5px;
        }

        .hazard-statements li {
            background-color: #ffebee;
            border-left: 4px solid var(--accent-color);
        }

        .precautionary-statements li {
            background-color: #e8f5e9;
            border-left: 4px solid var(--success-color);
        }

        /* Texto extraído */
        .extracted-text {
            white-space: pre-line;
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 5px;
            border-left: 4px solid var(--secondary-color);
            margin-top: 10px;
            max-height: 500px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            font-size: 14px;
            line-height: 1.4;
            color: #333;
        }

        .extracted-text table {
            width: 100%;
            border-collapse: collapse;
            margin: 10px 0;
        }

        .extracted-text th, .extracted-text td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }

        .extracted-text th {
            background-color: #f2f2f2;
            font-weight: bold;
        }

        .extracted-text strong {
            font-weight: bold;
            color: var(--primary-color);
        }

        .extracted-text em {
            font-style: italic;
        }

        .text-comparison {
            background-color: #fff3cd;
            border: 1px solid #ffeaa7;
            border-radius: 5px;
            padding: 15px;
            margin: 20px 0;
        }

        .text-comparison h3 {
            color: #856404;
            margin-bottom: 10px;
        }

        .link-btn {
            background: none;
            border: none;
            color: var(--secondary-color);
            text-decoration: underline;
            cursor: pointer;
            padding: 0;
        }

        .link-btn:hover {
            color: var(--primary-color);
        }

        .action-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        .print-btn {
            background-color: var(--success-color);
            color: white;
        }

        /* Indicadores de carga */
        .loading-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            flex-direction: column;
        }

        .loading-indicator .spinner {
            width: 30px;
            height: 30px;
            border: 3px solid rgba(52, 152, 219, 0.3);
            border-radius: 50%;
            border-top-color: var(--secondary-color);
            animation: spin 1s ease-in-out infinite;
            margin-bottom: 10px;
        }

        .button-loading {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mini-spinner {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }

        .loading-text {
            color: var(--dark-color);
            font-size: 14px;
        }

        /* Animaciones */
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

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

        /* Optimización para dispositivos móviles */
        @media (max-width: 768px) {
            #app {
                padding: 10px;
            }
            
            .screen {
                padding: 20px;
            }
            
            .product-card {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
            
            .product-actions {
                width: 100%;
                justify-content: space-between;
                flex-direction: column;
                gap: 8px;
            }
            
            .pdf-btn, .view-original-btn {
                width: 100%;
                text-align: center;
            }
            
            .action-buttons {
                flex-direction: column;
            }
            
            .extracted-text {
                font-size: 12px;
                padding: 10px;
            }
            
            .safety-section h3 {
                font-size: 16px;
            }
        }