body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

header {
    background-color: #ffffff;
    padding: 20px 40px 24px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

header p {
    margin: 5px 0 0;
    color: #7f8c8d;
    font-size: 1rem;
}

#header-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.header-btn, .compare-view-button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header-btn:hover, .compare-view-button:hover {
    background-color: #2980b9;
}

.compare-view-button {
    background-color: #27ae60;
}
.compare-view-button:hover {
    background-color: #229954;
}

#column-container, .compare-view-container, #search-view-container {
    display: flex;
    flex-grow: 1;
    overflow-x: auto;
    background-color: #f4f7f9;
    border-top: 1px solid #e0e0e0;
}

#column-container, .compare-view-container {
    flex-direction: row;
    background-color: #ffffff;
}

#search-view-container {
    flex-direction: column;
    padding: 20px 40px;
    overflow-y: auto;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
}

.search-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    gap: 12px;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 0;
}

.search-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.search-options label {
    margin: 0 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-options button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.indications-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.indications-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.drug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.drug-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #3498db;
}

.drug-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.drug-name {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.drug-section {
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
}

.drug-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.drug-section-title {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.tag:hover {
    transform: scale(1.05);
}

.tag.system { background-color: #e8f4fd; color: #2980b9; }
.tag.class { background-color: #f0f9e8; color: #27ae60; }
.tag.subclass { background-color: #f3e5f5; color: #8e24aa; }
.tag.mechanism { background-color: #fef9e7; color: #f39c12; }
.tag.indication { background-color: #fdf2e9; color: #e67e22; }
.tag.side-effect { background-color: #fdedec; color: #e74c3c; }
.tag.contraindication { background-color: #fff3cd; color: #856404; }
.tag.interaction { background-color: #e2e3e5; color: #495057; }

.detail-section .tag-container {
    margin-top: 10px;
}

.detail-section .tag {
    margin-bottom: 8px;
}

.interaction-explanation {
    margin-top: 12px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #e2e3e5;
}

.interaction-explanation p {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
    line-height: 1.4;
}

.indications-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.indication-tag {
    background-color: #ecf0f1;
    color: #34495e;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.indication-tag:hover {
    background-color: #bdc3c7;
}

#search-results {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.result-item {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-item h4 {
    margin: 0 0 5px 0;
    color: #3498db;
}

.result-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.column {
    min-width: 250px;
    max-width: 300px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.column-header {
    padding: 10px 15px;
    font-weight: 600;
    background-color: #ecf0f1;
    border-bottom: 1px solid #e0e0e0;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1;
}

.column-items {
    overflow-y: auto;
    flex-grow: 1;
}

.column-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.column-item .tag {
    font-size: 0.85rem;
    padding: 6px 12px;
    margin: 0;
}

.column-item:hover {
    background-color: #f5f5f5;
}

.column-item.selected {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

.column-item.selected .compare-btn {
    border-color: white;
    color: white;
}

.column-item.selected .compare-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.compare-btn {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 600;
}

.compare-btn:hover {
    background-color: #3498db;
    color: white;
}

.compare-btn.added {
    background-color: #27ae60;
    border-color: #27ae60;
    color: white;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.25);
}

.detail-view-column {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.compare-view-container .detail-view-column {
    flex-grow: 0;
    flex-shrink: 0;
    width: 450px;
    border-right: 1px solid #e0e0e0;
}

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

.detail-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    header {
        padding: 18px 24px 22px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 16px 16px 20px;
    }

    #header-controls {
        width: 100%;
    }

    .search-controls {
        align-items: stretch;
    }

    .search-options {
        flex-direction: column;
        align-items: stretch;
    }

    .search-options label {
        margin: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .search-options button {
        margin: 0;
        width: 100%;
    }
}
