* {
    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;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    padding: 20px 0;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
    color: white;
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Configuration Panel */
.config-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: fit-content;
}

.config-panel h2 {
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.config-section {
    margin-bottom: 25px;
}

.config-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.1rem;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.sequence-info {
    margin-top: 8px;
    font-size: 12px;
    color: #718096;
}

.demo-sequences {
    margin-top: 15px;
}

.demo-sequences label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.demo-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.demo-btn {
    padding: 6px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
}

.demo-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.demo-btn:active {
    background: #e2e8f0;
}

.params-grid {
    display: grid;
    gap: 15px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.param-group label {
    font-weight: 600;
    color: #4a5568;
}

.param-group input[type="number"],
.param-group select {
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.param-group select:focus,
.param-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.param-group input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.param-group span {
    font-size: 12px;
    color: #718096;
    text-align: center;
}

.rate-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.rate-input-group input[type="range"] {
    flex: 1;
    margin-bottom: 0;
}

.rate-input-group input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.rate-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.progress-info {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.progress-info div {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Visualization Panel */
.viz-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.viz-tabs {
    display: flex;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-btn:hover {
    background: #edf2f7;
}

.viz-content {
    height: 900px;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

#3d-container {
    width: 100%;
    height: 100%;
    background: #f7fafc;
    position: relative;
}

#3d-tab {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#3d-tab.active #3d-container {
    flex: 1;
}

.three-d-controls {
    padding: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.chart-container {
    height: 300px;
    padding: 15px;
    margin-bottom: 0;
}



/* Metrics Panel */
.metrics-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.metrics-panel h2 {
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.metrics-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Full Width Metrics Panel */
.metrics-panel-full {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    width: 100%;
}

.metrics-panel-full h2 {
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* Results Panel */
.results-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-panel h2 {
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.result-card h3 {
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3748;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .config-panel {
        order: 2;
    }
    
    .viz-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.config-panel, .viz-panel, .results-panel {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.config-panel:hover, .viz-panel:hover, .results-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Loading states */
.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 #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Hyperparameter Optimization Styles */
.hyperopt-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

.hyperopt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.hyperopt-buttons {
    display: flex;
    gap: 10px;
}

.hyperopt-progress h3 {
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-card h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #718096;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.summary-params {
    font-size: 12px;
    color: #4a5568;
    line-height: 1.4;
}

.results-visualization {
    margin-bottom: 20px;
    height: 300px;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    background: #f7fafc;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    font-size: 12px;
}

.table-container td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
}

.table-container tr:nth-child(even) {
    background: #f9fafb;
}

.table-container tr:hover {
    background: #edf2f7;
}

/* Info Tab Styles */
.info-content {
    padding: 20px;
    max-height: 1100px;
    overflow-y: auto;
}

.info-section {
    margin-bottom: 30px;
}

.info-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.info-section h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-section h5 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.tech-stack {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.tech-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tech-item h5 {
    margin-bottom: 8px;
    color: #2d3748;
}

.tech-item p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

.algorithm-info {
    display: grid;
    gap: 20px;
}

.algo-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
}

.algo-item h5 {
    margin-bottom: 10px;
    color: #2d3748;
}

.algo-item ul {
    list-style: none;
    padding: 0;
}

.algo-item li {
    margin-bottom: 8px;
    color: #4a5568;
    line-height: 1.5;
    font-size: 0.9rem;
    padding-left: 15px;
    position: relative;
}

.algo-item li:before {
    content: "•";
    color: #48bb78;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.features-list {
    display: grid;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #ed8936;
}

.feature-icon {
    font-size: 1.2rem;
    min-width: 24px;
}

.feature-item span:last-child {
    color: #4a5568;
    font-size: 0.95rem;
} 