* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Enhanced styles for interactive categories */

.product-categories {
    padding: 10px 15px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
    line-height: 2.2;
    position: relative;
}

.product-category-item {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 6px;
    padding: 4px 10px 4px 12px;
    background-color: #e6e6e6;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #d0d0d0;
}

.product-category-item:hover {
    background-color: #e0e0e0;
    border-color: #c0c0c0;
}

.product-category-item.selected {
    background-color: #004165;
    color: white;
    border-color: #003050;
}

.product-category-item.subcategory {
    background-color: #daeaf6;
    border-color: #b8d0e0;
}

.product-category-item.subcategory:hover {
    background-color: #c8e0f0;
    border-color: #a8c0d0;
}

.product-category-item.subcategory.selected {
    background-color: #0078b4;
    color: white;
    border-color: #006090;
}

.remove-btn {
    display: inline-block;
    margin-left: 6px;
    font-size: 16px;
    font-weight: bold;
    opacity: 0.6;
    vertical-align: middle;
    line-height: 1;
    width: 16px;
    height: 16px;
    text-align: center;
    border-radius: 50%;
}

.product-category-item:hover .remove-btn {
    opacity: 0.8;
}

.remove-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

.product-category-item.selected .remove-btn {
    color: white;
    opacity: 0.8;
}

.see-more-btn {
    display: inline-block;
    margin-left: 5px;
    cursor: pointer;
    color: #004165;
    font-size: 0.85em;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.see-more-btn:hover {
    background-color: #e0e0e0;
    text-decoration: underline;
}

/* Animation for adding/removing categories */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-category-item {
    animation: fadeIn 0.2s ease-out;
}

body {
    background-color: #f5f5f5;
}

.header {
    background-color: #004165;
    color: white;
    padding: 15px 20px;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 22px;
    font-weight: bold;
}

.back-link a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.back-link a:hover {
    text-decoration: underline;
}

.back-link i {
    margin-right: 5px;
}

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

.sidebar {
    width: 300px;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-right: 20px;
}

.main-content {
    flex: 1;
}

.search-bar {
    display: flex;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.search-bar .filter-label {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.sort-dropdown {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 150px;
}

.results-info {
    margin-bottom: 15px;
    font-size: 14px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
}

.filter-header .clear-btn {
    color: #004165;
    cursor: pointer;
    font-weight: normal;
    font-size: 14px;
}

.filter-option {
    margin-bottom: 8px;
}

.filter-option input {
    margin-right: 8px;
}

.filter-option label {
    font-size: 14px;
}

.expand-icon {
    cursor: pointer;
}

/* List View Styles - New for index.php */
.list-view {
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
}

.list-item {
    border-bottom: 1px solid #ddd;
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content {
    padding: 15px;
    flex: 1;
    cursor: pointer;
}

.list-item-content:hover {
    background-color: #f9f9f9;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
    color: #004165;
}

.list-item-details {
    display: flex;
    margin-bottom: 8px;
}

.item-theme, .item-phase {
    margin-right: 20px;
}

.item-theme .theme-label, .item-phase .phase-label {
    font-weight: bold;
    margin-right: 5px;
}

.list-item-categories {
    display: flex;
    flex-wrap: wrap;
}

.list-item-categories .category-item {
    display: inline-block;
    background-color: #e9e9e9;
    border-radius: 15px;
    padding: 4px 10px;
    margin: 2px;
    font-size: 0.85em;
}

.select-product {
    padding: 0 15px;
}

.view-details {
    padding: 0 20px;
    color: #004165;
    cursor: pointer;
}

.view-details:hover {
    color: #002040;
}

/* Card View Styles - Original styles for details.php */
.product-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.select-product {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 5;
}

.product-select-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.product-header {
    background-color: #004165;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;

}

.product-title {
    font-weight: bold;
}

.product-cpv {
    font-size: 0.9em;
    opacity: 0.9;
}

.category-list {
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    padding: 0;
}

.category-list-header {
    padding: 10px 15px;
    background-color: #e0e0e0;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.category-items {
    display: none;
    padding: 10px 15px;
    background-color: #f9f9f9;
}

.category-item {
    display: inline-block;
    background-color: #e9e9e9;
    border-radius: 15px;
    padding: 5px 10px;
    margin: 3px;
    font-size: 0.9em;
}

.remove-category {
    cursor: pointer;
    color: #004165;
    margin-left: 5px;
}

.product-card.selected, .list-item.selected {
    border: 2px solid #004165;
}

.list-item.selected {
    background-color: #f0f7fc;
}

.loading, .error-message, .no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.error-message {
    color: #d9534f;
}

.product-content {
    padding: 15px;
    background-color: white;
    display: flex;
    position: relative;
}

.nested-details {
    display: none;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

.nested-card {
    border-bottom: 1px solid #ddd;
}

.nested-header, .sub-nested-header {
    padding: 12px 15px;
    background-color: #e9e9e9;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
}

.sub-nested-header {
    background-color: #f1f1f1;
    padding-left: 30px;
}

.nested-content {
    padding: 15px;
    display: none;
    background-color: white;
}

.sub-nested-card {
    border-top: 1px solid #eaeaea;
}

.sub-nested-card:first-child {
    border-top: none;
}

.expand-icon {
    font-weight: bold;
    color: #004165;
}

.product-theme, .product-phase {
    flex: 1;
}

.theme-label, .phase-label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

.theme-value, .phase-value {
    font-size: 14px;
}

.download-btn, .view-details-btn {
    background-color: #004165;
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
}

.download-btn:hover, .view-details-btn:hover {
    background-color: #003050;
}

.reset-btn {
    color: #004165;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.detail-btn {
    background-color: #004165;
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}