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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

/* Search section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#searchInput {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchBtn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.quick-search {
    background: rgba(102, 126, 234, 0.1);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.quick-search p {
    margin: 0 0 0.8rem 0;
    font-size: 0.9rem;
    color: #555;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Main content - Two Column Layout */
.main-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.right-column {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px);
}

/* Controls section */
.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.controls h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.molecule-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.molecule-buttons button {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.molecule-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.molecule-buttons button:active {
    transform: translateY(0);
}

.controls-info {
    background: rgba(102, 126, 234, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.controls-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
}

.control-buttons {
    margin-top: 2rem;
}

.control-buttons h3 {
    color: #667eea;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.3rem;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.button-group button {
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    flex: 1;
    min-width: 120px;
}

.button-group button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.button-group button:active {
    transform: translateY(0);
}

.button-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Colorblind accessibility styles */
.colorblind-controls {
    margin-bottom: 1.5rem;
}

.colorblind-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.colorblind-btn {
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    flex: 1;
    min-width: 110px;
    text-align: center;
}

.colorblind-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.colorblind-btn.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transform: scale(1.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); }
}

.colorblind-btn:active {
    transform: translateY(0);
}

.color-legend {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.color-legend h4 {
    color: #667eea;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.3rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-label {
    color: #555;
    font-weight: 500;
}

/* Colorblind info tooltip */
.colorblind-info {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    padding: 0.8rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    border-left: 4px solid #667eea;
}

/* Colorblind mode indicators */
.colorblind-btn[data-mode="normal"]:hover::after {
    content: "Standard color vision";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

.colorblind-btn[data-mode="protanopia"]:hover::after {
    content: "Red-blind friendly (no reds)";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

.colorblind-btn[data-mode="deuteranopia"]:hover::after {
    content: "Green-blind friendly (no greens)";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

.colorblind-btn[data-mode="tritanopia"]:hover::after {
    content: "Blue-blind friendly (no blues)";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

.colorblind-btn[data-mode="achromatopsia"]:hover::after {
    content: "Complete colorblind (grayscale)";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

.colorblind-btn {
    position: relative;
}

/* Responsive colorblind controls */
@media (max-width: 768px) {
    .colorblind-modes {
        flex-direction: column;
    }

    .colorblind-btn {
        min-width: auto;
        width: 100%;
    }

    .legend-item {
        font-size: 0.8rem;
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }
}

/* Visualization section */
.visualization {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.canvas-container {
    position: relative;
    height: 600px;
    background: #f8f9fa;
    min-height: 400px;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.info {
    padding: 2rem;
    background: white;
    text-align: center;
}

.info h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.info p {
    color: #666;
    line-height: 1.5;
}

.molecule-details {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}

.detail-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* MVP 4 Status Panel */
.status-panel {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.status-panel h4 {
    color: #667eea;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.3rem;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.status-label {
    color: #666;
    font-weight: 500;
}

.status-value {
    color: #667eea;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.status-value.active {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    text-align: center;
    color: white;
    margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 320px 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .left-column {
        max-height: none;
        overflow-y: visible;
    }

    .right-column {
        min-height: auto;
    }

    header h1 {
        font-size: 2rem;
    }

    .molecule-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .molecule-buttons button {
        flex: 1;
        min-width: 120px;
    }

    .canvas-container {
        height: 400px;
    }
}