* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 2.5em;
}

.input-section {
    text-align: center;
    margin-bottom: 40px;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #555;
}

.case-hint {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 12px;
    background-color: #e8f4f8;
    color: #3498db;
    font-size: 0.9em;
    border-radius: 12px;
}

#mrnaInput {
    width: 100%;
    max-width: 500px;
    padding: 12px 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#mrnaInput:focus {
    outline: none;
    border-color: #3498db;
}

button {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 8px;
    transition: background-color 0.3s;
}

#translateBtn {
    background-color: #3498db;
    color: white;
}

#translateBtn:hover {
    background-color: #2980b9;
}

#clearBtn {
    background-color: #95a5a6;
    color: white;
}

#clearBtn:hover {
    background-color: #7f8c8d;
}

.visualization-section {
    margin-bottom: 40px;
}

.visualization-section h3 {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}

#mrnaVisualization {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    min-height: 120px;
    overflow-x: auto;
    overflow-y: hidden;
}

.nucleotide-row {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    padding-bottom: 5px;
    width: fit-content;
}

.base-bar {
    width: fit-content;
    height: 15px;
    background: linear-gradient(to bottom, #88d498, #52b788);
    border-radius: 3px;
    margin-top: 5px;
    min-width: 100%;
}

.nucleotide {
    width: 32px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    position: relative;
}

.nucleotide-G {
    background: linear-gradient(to bottom, #4a90e2, #2e6bc4);
    border-radius: 50% 50% 0 0;
    height: 100px;
    width: 32px;
}

.nucleotide-U {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    clip-path: polygon(50% 35%, 100% 0%, 100% 100%, 0% 100%, 0% 0%);
    height: 75px;
    width: 32px;
}

.nucleotide-C {
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
    clip-path: polygon(0% 0%, 10% 20%, 25% 30%, 40% 35%, 50% 36%, 60% 35%, 75% 30%, 90% 20%, 100% 0%, 100% 100%, 0% 100%);
    height: 75px;
    width: 32px;
}

.nucleotide-A {
    background: linear-gradient(to bottom, #f39c12, #e67e22);
    clip-path: polygon(50% 0%, 100% 35%, 100% 100%, 0% 100%, 0% 35%);
    height: 100px;
}

.result-section {
    margin-top: 30px;
}

.error {
    color: #e74c3c;
    text-align: center;
    font-size: 1.1em;
    padding: 15px;
    background-color: #ffebee;
    border-radius: 8px;
    margin-bottom: 20px;
}

#proteinResult {
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.protein-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.protein-sequence {
    font-size: 1.1em;
    color: #34495e;
    word-break: break-all;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
}

.codon-highlight {
    display: inline-block;
    padding: 3px 6px;
    margin: 2px;
    border-radius: 4px;
    background-color: #d4e6f1;
}

.start-codon {
    background-color: #a9dfbf;
}

.stop-codon {
    background-color: #f5b7b1;
}

.codon-hints {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hint-box {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.hint-box h4 {
    color: #555;
    margin-bottom: 12px;
    font-size: 1em;
}

.codon-list {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.codon-tag {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    color: white;
}

.codon-tag.start {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
}

.codon-tag.stop {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
}

.history-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.history-section h3 {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}

#historyList {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.history-item {
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    background-color: #f0f8ff;
    border-left-color: #2980b9;
    transform: translateX(5px);
}

.history-item-header {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 8px;
}

.history-item-sequence {
    font-family: monospace;
    font-size: 1em;
    color: #2c3e50;
    word-break: break-all;
    margin-bottom: 5px;
}

.history-item-protein {
    font-size: 0.95em;
    color: #27ae60;
}

.clear-history-btn {
    display: block;
    margin: 0 auto;
    padding: 10px 25px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s;
}

.clear-history-btn:hover {
    background-color: #c0392b;
}

.no-history {
    text-align: center;
    color: #888;
    font-size: 1em;
    padding: 20px;
}