/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #E6E6FA 0%, #B0C4DE 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Navigation Header */
.nav-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
}

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

/* Header */
.header {
    text-align: center;
    padding: 60px 0 40px;
    color: #0A0A74;
}

.header-content {
    max-width: 700px;
    margin: 0 auto;
}

.title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    white-space: nowrap;
    color: #0A0A74;
}

.title i {
    font-size: 2.5rem;
    color: #448FFF;
}

.subtitle {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: #0A0A74;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 10px;
}

.subtitle-compound {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #0A0A74;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 0;
}

.compound-info {
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

/* Main content */
.main-content {
    background: transparent;
    margin-bottom: 40px;
}

/* Search section */
.search-section {
    padding: 30px;
    background: transparent;
    margin: 0 20px 40px;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    gap: 10px;
    background: transparent;
    width: 100%;
    margin: 0 0 15px 0;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 20px 30px;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-family: inherit;
    min-width: 0;
    background: white;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: #333;
    width: 100%;
}

.search-input::placeholder {
    color: #999;
}

.add-button {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.add-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.selected-drugs-container {
    margin-bottom: 20px;
}

.selected-drugs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 20px;
}

.drug-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.drug-tag .remove-drug {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.drug-tag .remove-drug:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.search-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-button {
    background: linear-gradient(135deg, #0A0A74 0%, #448FFF 100%);
    color: white;
    border: none;
    padding: 20px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.search-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.suggestion-item:first-child {
    border-radius: 10px 10px 0 0;
}

.suggestion-item:last-child {
    border-radius: 0 0 10px 10px;
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.suggestion-item:not(:last-child):hover {
    border-bottom-color: #3b82f6;
}

.advanced-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.advanced-button {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 15px 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.advanced-button:hover {
    background: #e9ecef;
    color: #495057;
}

/* Advanced Search Panel */
.advanced-panel {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.advanced-panel h3 {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    color: #0A0A74;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.advanced-description {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #0A0A74;
    opacity: 0.8;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.filter-checkbox:hover {
    background-color: #f8f9fa;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.filter-checkbox span {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.advanced-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.secondary-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.secondary-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #448FFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error */
.error {
    background: #fee;
    color: #c53030;
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
    border-left: 4px solid #c53030;
    text-align: center;
}

/* Results */
.results {
    padding: 40px;
}

/* Container for drug results to enable side-by-side layout */
#drugsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 450px));
    gap: 30px;
    justify-content: center;
}

/* Large screens - fit as many as possible horizontally */
@media (min-width: 1200px) {
    #drugsContainer {
        grid-template-columns: repeat(auto-fit, minmax(400px, 500px));
        gap: 30px;
    }
}

/* Extra large screens - even more horizontal space */
@media (min-width: 1600px) {
    #drugsContainer {
        grid-template-columns: repeat(auto-fit, minmax(350px, 450px));
        gap: 25px;
    }
}

/* Medium screens - tablets */
@media (min-width: 768px) and (max-width: 1199px) {
    #drugsContainer {
        grid-template-columns: repeat(auto-fit, minmax(350px, 450px));
        gap: 25px;
    }
}

.drug-result {
    margin-bottom: 0; /* Remove bottom margin since we're using grid gap */
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.drug-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e2e8f0;
}

.drug-title {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 2rem;
    color: #0A0A74;
    margin-bottom: 10px;
}

.drug-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.meta-item {
    background: #ECF3F8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #0A0A74;
    border: 1px solid #AACCFF;
}

.drug-sections {
    padding: 30px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}



.section-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.section-header {
    background: linear-gradient(135deg, #012CD5 0%, #448FFF 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.section-header i {
    font-size: 1.2rem;
}

.section-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.7;
}

.section-content p {
    margin-bottom: 15px;
    color: #0A0A74;
}

.section-content h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d4ed8;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #e2e8f0;
}

.section-content h4:first-child {
    margin-top: 0;
}

.section-content:empty::after {
    content: "Information not available";
    color: #4747D4;
    font-style: italic;
}

/* Drug Tables */
.drug-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.drug-table th {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.drug-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e5e7eb;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.drug-table tr:last-child td {
    border-bottom: none;
}

.drug-table tr:hover {
    background-color: #f8fafc;
}

/* Responsive tables */
@media (max-width: 768px) {
    .drug-table {
        font-size: 12px;
    }
    
    .drug-table th,
    .drug-table td {
        padding: 8px 10px;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #0A0A74;
    opacity: 0.8;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer a:hover {
    opacity: 0.7;
}

/* Floating Chat Button */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0A0A74;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(10, 10, 116, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    z-index: 1000;
}

.chat-button:hover {
    background: #448FFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(68, 143, 255, 0.4);
}

.chat-button i {
    font-size: 1.1rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .search-button {
        border-radius: 0 0 15px 15px;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
    
    .drug-meta {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .results {
        padding: 20px;
    }
    
    .search-section {
        padding: 30px 20px;
    }
    
    /* Ensure drugs stack vertically on mobile */
    #drugsContainer {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .drug-title {
        font-size: 1.5rem;
    }
}

/* Drug Selection Interface */
.drug-selection {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.selection-header {
    text-align: center;
    margin-bottom: 30px;
}

.selection-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #0A0A74;
    margin-bottom: 10px;
}

.selection-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.option-group {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.group-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0A0A74;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #448FFF;
}

.option-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.option-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #448FFF;
    transform: translateY(-2px);
}

.option-info {
    flex: 1;
}

.option-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0A0A74;
    margin-bottom: 5px;
}

.option-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 3px;
    font-weight: 500;
}

.option-manufacturer {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #868e96;
    font-weight: 400;
}

.select-option-btn {
    background: linear-gradient(135deg, #0A0A74 0%, #448FFF 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-left: 20px;
}

.select-option-btn:hover {
    background: linear-gradient(135deg, #012CD5 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Responsive design for drug selection */
@media (max-width: 768px) {
    .option-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .select-option-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .selection-title {
        font-size: 1.5rem;
    }
    
    .group-title {
        font-size: 1.1rem;
    }
} 