/* styles.css */
:root {
    --background-color: #1e1e1e;
    --text-color: #e0e0e0;
    --tile-background: #252525;
    --tile-shadow: rgba(0, 0, 0, 0.3);
    --tile-border: #444;
    --chart-line-color: #40c4ff;
    --chart-grid-color: #444;
    --chart-label-color: #b0b0b0;
    --chart-point-color: #40c4ff;
    --sidebar-background: #2e2e2e;
    --sidebar-text-color: #e0e0e0;
    --button-background: #40c4ff;
    --button-hover: #29b6f6;
}

body.theme-light {
    --background-color: #f5f5f5;
    --text-color: #1a1a1a;
    --tile-background: #ffffff;
    --tile-shadow: rgba(0, 0, 0, 0.1);
    --tile-border: #e0e0e0;
    --chart-line-color: #0288d1;
    --chart-grid-color: #e0e0e0;
    --chart-label-color: #666;
    --chart-point-color: #0288d1;
    --sidebar-background: #fafafa;
    --sidebar-text-color: #1a1a1a;
    --button-background: #0288d1;
    --button-hover: #0277bd;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

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

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

h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

#compare-btn {
    background-color: var(--button-background);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

#compare-btn:hover {
    background-color: var(--button-hover);
}

#sidebar-toggle {
    background-color: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--sidebar-background);
    color: var(--sidebar-text-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.sidebar.open {
    right: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-content input,
.sidebar-content select,
.sidebar-content button {
    padding: 10px;
    border: 1px solid var(--tile-border);
    border-radius: 6px;
    background-color: var(--tile-background);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 400;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.sidebar-content input:focus,
.sidebar-content select:focus {
    border-color: var(--chart-line-color);
    outline: none;
}

.sidebar-content button {
    cursor: pointer;
    background-color: var(--button-background);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.sidebar-content button:hover {
    background-color: var(--button-hover);
}

#theme-toggle {
    background-color: transparent;
    border: none;
    font-size: 1.5em;
    color: var(--text-color);
}

.info-message {
    color: #ff5252;
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: 400;
}

.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 10px;
}

.tile {
    background-color: var(--tile-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--tile-shadow);
    user-select: none;
    cursor: move;
    transition: transform 0.2s;
}

.tile:hover {
    transform: translateY(-2px);
}

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

.tile-header-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tile-checkbox {
    margin-right: 8px;
}

.tile-header span {
    font-size: 16px;
    font-weight: 600;
}

.tile-header-buttons {
    display: flex;
    gap: 8px;
}

.flip-btn, .zoom-out-btn, .delete-btn {
    background-color: var(--button-background);
    color: transparent; /* Hide default text/icon */
    border: none;
    border-radius: 4px; /* Smaller, modern radius */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.flip-btn:hover, .zoom-out-btn:hover, .delete-btn:hover {
    background-color: var(--button-hover);
}

/* Single-line designs using pseudo-elements */
.flip-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: white;
    transform: rotate(45deg);
}

.zoom-out-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    box-sizing: border-box;
}

.delete-btn::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: white;
    transform: rotate(45deg);
}

.delete-btn::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: white;
    transform: rotate(-45deg);
}

.zoom-out-btn {
    background-color: #2196F3;
}

.zoom-out-btn:hover {
    background-color: #1e88e5;
}

.delete-btn {
    background-color: #ff5252;
}

.delete-btn:hover {
    background-color: #e04848;
}

.tile-flipper {
    position: relative;
    width: 100%;
    height: auto;
}

.tile-front, .tile-back {
    width: 100%;
    background-color: var(--tile-background);
    border-radius: 8px;
    padding: 10px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tile-front {
    display: block;
    opacity: 1;
    visibility: visible;
}

.tile-back {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.tile-flipper.flipped .tile-front {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.tile-flipper.flipped .tile-back {
    display: block;
    opacity: 1;
    visibility: visible;
}

.tile-flipper.collapsed {
    height: 0;
    opacity: 0;
    padding: 0 10px;
}

.text-content {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 10px;
}

.chart-container {
    margin-top: 10px;
    height: 150px;
    position: relative;
    overflow: hidden;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.table-container {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--tile-background);
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--tile-border);
}

th {
    background-color: var(--tile-background);
    color: var(--text-color);
    position: sticky;
    top: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .table-container {
        max-height: 150px;
        font-size: 12px;
    }
    .chart-container {
        height: 120px;
    }
    .sidebar {
        width: 250px;
        right: -250px;
    }
    .sidebar.open {
        right: 0;
    }
    .tile {
        padding: 15px;
    }
    .tile-header span {
        font-size: 14px;
    }
    .text-content {
        font-size: 13px;
    }
}

.ai-response-content h1,
.ai-response-content h2,
.ai-response-content h3 {
    margin: 10px 0;
    font-weight: 600;
}
.ai-response-content strong {
    font-weight: 600;
}
.ai-response-content ul {
    list-style-type: disc;
    padding-left: 20px;
}
.ai-response-content li {
    margin-bottom: 5px;
}

/*for the knowledge graph*/

.header-title {
    display: flex;
    align-items: center; /* Vertically center the icon and title */
    gap: 10px; /* Space between the icon and the title */
}

.header-icon {
    width: 40px; /* Adjust the size of the icon */
    height: 40px;
    object-fit: contain; /* Ensure the icon scales properly */
}

.header h1 {
    margin: 0; /* Remove default margin from the h1 */
    font-size: 24px; /* Adjust font size if needed */
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}