/* Notice box */
.notice {
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    margin-bottom: 30px;
    background-color: var(--notice-bg);
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.notice b {
    font-weight: 700;
}

/* Database Selection */
.apiprofil-db-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--abstract-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.db-button {
    padding: 8px 16px;
    background-color: var(--paper-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Crimson Pro', 'Times New Roman', Times, serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-button:hover {
    background-color: var(--abstract-bg);
}

.db-button.active {
    background-color: var(--text-color);
    color: var(--paper-bg);
    border-color: var(--text-color);
}

/* Loading and Error states */
.apiprofil-loading {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--abstract-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 30px;
    font-weight: 600;
    font-style: italic;
    transition: all 0.3s ease;
}

.apiprofil-error {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--notice-bg);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Search Section */
.apiprofil-search-section {
    display: flex;
    gap: 10px;
    align-items: stretch;
    padding: 20px;
    background-color: var(--abstract-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.autocomplete-container {
    position: relative;
    flex-grow: 1;
    display: flex;
}

.search-input {
    flex-grow: 1;
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--paper-bg);
    color: var(--text-color);
    font-family: 'Crimson Pro', 'Times New Roman', Times, serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: 2px solid var(--text-color);
    border-color: var(--text-color);
}

.apiprofil-reset-button {
    padding: 10px 15px;
    background-color: var(--paper-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Crimson Pro', 'Times New Roman', Times, serif;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.apiprofil-reset-button:hover {
    background-color: var(--abstract-bg);
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--paper-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.autocomplete-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.autocomplete-dropdown li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--light-border);
    transition: background-color 0.2s ease;
    font-size: 15px;
}

.autocomplete-dropdown li:last-child {
    border-bottom: none;
}

.autocomplete-dropdown li:hover,
.autocomplete-dropdown li.selected {
    background-color: var(--abstract-bg);
}

.autocomplete-dropdown .highlight {
    font-weight: 700;
    background: transparent;
}

.autocomplete-empty {
    padding: 15px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
    font-size: 14px;
}

/* Placeholder */
.apiprofil-placeholder {
    text-align: center;
    padding: 40px 30px;
    background-color: var(--abstract-bg);
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.apiprofil-placeholder p {
    text-align: center;
    margin: 0;
}

.apiprofil-placeholder b {
    font-weight: 700;
}

/* Results Container */
.apiprofil-results-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.apiprofil-result {
    background-color: var(--abstract-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 25px;
    transition: all 0.3s ease;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-style: italic;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.profile-item {
    background-color: var(--paper-bg);
    border: 1px solid var(--light-border);
    border-radius: 4px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.profile-item:hover {
    border-color: var(--border-color);
}

.profile-item-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.criterion-abbr {
    font-size: 12px;
    opacity: 0.6;
    font-weight: 400;
    font-style: italic;
}

.profile-item-value {
    font-weight: 700;
    font-size: 16px;
    padding: 4px 10px;
    border-radius: 3px;
    border: 2px solid;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
}

/* Color coding for values */
.profile-item-value.color-high {
    border-color: #52c234;
    color: #52c234;
    background-color: rgba(82, 194, 52, 0.05);
}

.profile-item-value.color-mid {
    border-color: #3498db;
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.profile-item-value.color-low {
    border-color: #e67e22;
    color: #e67e22;
    background-color: rgba(230, 126, 34, 0.05);
}

.profile-item-value.color-vlow {
    border-color: #e74c3c;
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

.profile-item-value.color-na {
    border-color: var(--light-border);
    color: var(--text-color);
    opacity: 0.5;
    background-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .apiprofil-search-section {
        flex-direction: row;
        align-items: stretch;
    }

    .apiprofil-result {
        padding: 20px 15px;
    }

    .result-title {
        font-size: 18px;
    }
}

/* Print styles */
@media print {
    .apiprofil-db-select,
    .apiprofil-search-section,
    .apiprofil-placeholder {
        display: none;
    }

    .apiprofil-result {
        page-break-inside: avoid;
        border: 2px solid black;
        background-color: white;
    }

    .profile-item {
        border: 1px solid black;
    }
}
