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

header {
    background-color: #3498db;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

main {
    max-width: 1500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    color: #777;
    border-top: 1px solid #eee;
}

/* Estilos del diagrama */
.diagram-container {
    margin: 2rem 0;
}

.diagram {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.step-box {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    width: 250px;
    min-height: 150px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.step-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.step-box h3 {
    color: #3498db;
    margin-bottom: 1rem;
    text-align: center;
}

.arrow {
    font-size: 2rem;
    color: #3498db;
    display: flex;
    align-items: center;
}

.feedback-loop {
    display: flex;
    align-items: center;
    position: relative;
}

.loop {
    font-size: 2.5rem;
    transform: rotate(-45deg);
}

/* Dropdown de prompts */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 4px;
    top: 100%;
    left: 0;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f1f8ff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFade 0.3s;
}

@keyframes modalFade {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #333;
}

/* Estilo para los inputs y botones del modal */
.parameter-container {
    margin: 1.5rem 0;
}

.parameter-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.parameter-container input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.generated-prompt-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f7f9fc;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.generated-prompt-container h3 {
    margin-bottom: 0.5rem;
    color: #3498db;
}

#generatedPrompt {
    margin: 1rem 0;
    line-height: 1.6;
    white-space: pre-wrap;
}

.action-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.action-button:hover {
    background-color: #2980b9;
}

/* Botones principales */
.buttons-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.main-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.main-button:hover {
    background-color: #27ae60;
}

/* Historial de prompts */
.history-content {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#historyContainer {
    margin-top: 1.5rem;
}

.history-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

.history-metadata {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.history-prompt {
    background-color: #f7f9fc;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 1200px) {
    .diagram {
        flex-direction: column;
    }
    
    .step-box {
        width: 100%;
    }
    
    .arrow {
        transform: rotate(90deg);
        height: 150px;
    }
    
    .loop {
        transform: rotate(45deg);
        height: 150px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}
