/* Modern CSS reset and variables */
:root {
    --primary-color: #2196F3;
    --secondary-color: #FFC107;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 20px;
    color: var(--text-color);
}

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

/* Controls styling */
.controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

#search {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    width: 300px;
    font-size: 16px;
}

/* Chart styling */
.chart-container {
    width: 100%;
    height: 600px;  /* Default height for bubble chart */
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
}

/* Specific height and padding for box office chart container */
#boxOfficeChart {
    height: 400px !important;
}

.chart-container:has(#boxOfficeChart) {
    height: 450px;  /* Reduced container height */
    padding: 0.5rem;  /* Reduced padding */
}

/* Table styling */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 98%;
    margin: 2rem auto;
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

th, td {
    padding: 15px 30px 15px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    min-width: 100px;
}

th {
    background-color: var(--primary-color);
    color: white;
}

.column-filter {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    #search {
        width: 100%;
    }
}

canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: auto;
}

/* Charts section */
.charts-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

h1 {
    text-align: center;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.goto-table {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.goto-table:hover {
    background-color: #1976D2;
}

.statistics-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.stats-button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.stats-button:hover {
    background-color: #1976D2;
}

.stats-select {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
}

/* Detailed statistics section */
#detailedStats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0;
    width: 100%;
}

/* Detailed statistics charts */
.detailed-chart {
    height: 400px;
    width: 100%;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

#regenerateBubble {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#regenerateBubble:hover {
    background-color: #1976D2;
}