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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    padding: 20px;
}

.container {
    display: flex;
    max-width: 1600px;
    margin: auto;
    gap: 30px; /* Space between panels */
}

.products-panel {
    flex: 1; /* Takes up 1/2 available space */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 40px); /* Full height minus body padding */
    overflow-y: auto; /* Allow scrolling if needed */
}

.profile-panel {
    flex: 1; /* Takes up 1/2 available space */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 40px); /* Full height */
    overflow-y: auto; /* Allow scrolling */
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h2 {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

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

/* Product Tiles Styling */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive grid */
    gap: 20px; /* Spacing between tiles */
}

.product-tile {
    aspect-ratio: 1 / 1; /* Square tiles */
    border-radius: 12px; /* Rounded corners */
    overflow: hidden; /* Keep content inside */
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Glossy Effect */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 2px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-tile::before { /* Glossy highlight */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none; /* Allow clicks through the highlight */
}


.product-tile:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 4px rgba(255, 255, 255, 0.6) inset;
}

.tile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0)); /* Gradient background */
    color: white;
    padding: 15px 10px 10px 10px; /* More padding at the bottom */
    font-size: 0.9em;
    transition: opacity 0.3s ease;
}

.tile-title {
    font-weight: bold;
    display: block; /* Ensure it takes full width */
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-category {
    font-size: 0.8em;
    color: #e0e0e0;
    display: block; /* Ensure it takes full width */
     white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Profile and Recommendations Styling */
#persona-chart {
    min-height: 300px; /* Ensure chart has space */
}

#category-profile ul {
    list-style: none;
    padding-left: 0;
}
#category-profile li {
    margin-bottom: 5px;
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.recommendations-container {
    margin-top: 15px;
    flex-grow: 2; /* Take remaining vertical space */
   /* overflow-y: auto; /* Scroll if recommendations exceed space */
}

.recommendations-container ol {
    list-style-position: inside;
    padding-left: 0;
}

.recommendation-item {
    background-color: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    position: relative; /* Needed for tooltip positioning */
    cursor: default; /* Indicate it's informative */
     transition: background-color 0.2s ease;
}
.recommendation-item:hover {
    background-color: #e9ecef;
}


.recommendation-title {
    font-weight: bold;
    display: block;
}

.recommendation-category {
    font-size: 0.85em;
    color: #6c757d;
    display: block;
}

/* Tooltip Styling */
.tooltip {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #343a40;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.85em;
    z-index: 100; /* Ensure it's on top */
    min-width: 250px; /* Minimum width */
    max-width: 400px; /* Maximum width */
    white-space: normal; /* Allow text wrapping */
    /* Position will be set by JS on hover */
    pointer-events: none; /* Don't interfere with mouse events on the item */
}

.tooltip h4 {
    margin-bottom: 8px;
    color: #f8f9fa;
    font-size: 1em;
    border-bottom: 1px solid #6c757d;
    padding-bottom: 5px;
}

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

.tooltip li {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.tooltip .persona-name {
    margin-right: 10px;
}

.tooltip .persona-score {
    font-weight: bold;
    color: #adb5bd;
}

/* Show tooltip on hover of the parent item */
.recommendation-item:hover .tooltip {
    display: block;
}

/* Scrollbar styling (optional) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}