:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2ecc71;
    --secondary-dark: #27ae60;
    --warning: #e74c3c;
    --warning-dark: #c0392b;
    --balanced: #1abc9c;
    --text: #333;
    --background: #f5f5f5;
    --card: #fff;
    --border: #ddd;
    --cpu-color: #ff5555;
    --gpu-color: #5555ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    padding: 0;
    margin: 0;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 {
    margin-bottom: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background-color: var(--card);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    gap: 1rem;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

select, input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-dark);
}

.advanced-toggle {
    margin: 1rem 0;
    cursor: pointer;
    color: var(--primary);
    display: inline-block;
}

.advanced-options {
    display: none;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.results {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bottleneck-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: bold;
    color: white;
}

.bottleneck-balanced {
    background-color: var(--balanced);
}

.bottleneck-mild {
    background-color: var(--secondary);
}

.bottleneck-moderate {
    background-color: #f39c12;
}

.bottleneck-significant {
    background-color: #e67e22;
}

.bottleneck-severe {
    background-color: var(--warning);
}

.details-section {
    margin-bottom: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    background-color: rgba(0,0,0,0.03);
    padding: 0.5rem;
    border-radius: 4px;
}

.detail-item strong {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.detail-item span {
    font-size: 1.1rem;
}

/* Recommendation Styles */
.recommendations {
    margin-top: 2rem;
}

.recommendation-item {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}

.recommendation-item.high-priority {
    border-left-color: var(--warning);
}

.recommendation-item.medium-priority {
    border-left-color: #f39c12;
}

.recommendation-item.low-priority {
    border-left-color: var(--secondary);
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-group {
        min-width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .bottleneck-indicator {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* =========== CHART STYLES =========== */
/* Chart container */
#fps-chart-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 30px; /* Space for target line label */
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Charts.css configuration */
#fps-chart-container .charts-css {
    --chart-height: 200px;
    height: var(--chart-height);
    max-width: 100%;
}

/* Chart labels */
#fps-chart-container caption {
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Row labels */
#fps-chart-container th {
    padding-right: 1rem;
    font-weight: normal;
}

/* CPU bar color */
#fps-chart-container tr:nth-of-type(1) td {
    --color: var(--cpu-color);
}

/* GPU bar color */
#fps-chart-container tr:nth-of-type(2) td {
    --color: var(--gpu-color);
}

/* FPS data labels inside bars */
#fps-chart-container .data {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-weight: bold;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}

/* Target line */
.target-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #e74c3c;
    left: 0;
    z-index: 10;
}

.target-label {
    position: absolute;
    right: 0;
    top: -20px;
    background-color: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Animations */
/* Bar animations */
@keyframes grow-bar {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

#fps-chart-container .charts-css td {
    transform-origin: left;
    animation: grow-bar 1s ease-out forwards;
}

/* Staggered animations */
#fps-chart-container tr:nth-child(1) td {
    animation-delay: 0.1s;
}

#fps-chart-container tr:nth-child(2) td {
    animation-delay: 0.3s;
}

/* Target line fade in */
@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

#targetLine {
    animation: fade-in 1s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* FPS value animation */
@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

#fps-chart-container .data {
    animation: pop-in 0.6s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

/* Value change animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #ffff00; }
    100% { transform: scale(1); }
}

.value-changed {
    animation: pulse 0.6s ease;
}

/* Hover effects */
#fps-chart-container td:hover {
    filter: brightness(1.1);
}


/* Add this to your styles.css file to fix the overlapping labels */

/* Wider space for chart labels */
#fps-chart-container th {
    padding-right: 2rem !important;
    width: 120px !important;
    text-align: left !important;
    font-weight: normal;
}

/* Ensure labels don't wrap */
#fps-chart-container th[scope="row"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add more space between chart rows */
#fps-chart-container tr {
    height: 40px;
}

/* Make sure chart has enough width */
#fps-chart-container .charts-css {
    --chart-height: 200px;
    height: var(--chart-height);
    max-width: 100%;
    margin-left: 120px; /* Add space for labels */
}

/* Adjust spacing for data points */
#fps-chart-container .charts-css.bar.data-spacing-4 tbody tr td {
    margin-inline-start: 6px;
}


/* Enhanced styling for FPS chart - add this to your styles.css */

/* Chart container with proper padding and background */
#fps-chart-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Chart title styling */
#fps-chart-container caption {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #333;
}

/* Chart axis and structure */
#fps-chart-container .charts-css {
    --chart-height: 150px;
    height: var(--chart-height);
    width: 100%;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2rem;
    margin-bottom: 1rem;
}

/* Row styling and spacing */
#fps-chart-container tbody tr {
    margin-bottom: 1.5rem;
    height: 40px;
}

/* Label styling */
#fps-chart-container th {
    padding-right: 1rem;
    font-weight: 500;
    color: #555;
    width: 90px;
    text-align: left;
    font-size: 0.9rem;
}

/* CPU bar styling */
#fps-chart-container tr:nth-of-type(1) td {
    --color: #ff6b6b;
    border-radius: 4px;
    opacity: 0.9;
}

/* GPU bar styling */
#fps-chart-container tr:nth-of-type(2) td {
    --color: #4dabf7;
    border-radius: 4px;
    opacity: 0.9;
}

/* Hover effects */
#fps-chart-container td:hover {
    opacity: 1;
    filter: brightness(1.05);
    transition: all 0.2s ease;
}

/* FPS data values */
#fps-chart-container .data {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Target line styling */
.target-line {
    position: absolute;
    width: calc(100% - 120px);
    height: 2px;
    background-color: rgba(231, 76, 60, 0.7);
    right: 0;
    z-index: 10;
}

.target-label {
    position: absolute;
    right: 0;
    top: -20px;
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Animation for data values */
@keyframes pop-in {
    0% { opacity: 0; transform: translateY(-50%) scale(0.7); }
    70% { transform: translateY(-50%) scale(1.1); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

#fps-chart-container .data {
    animation: pop-in 0.5s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* Value change animation */
@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); background-color: rgba(255, 255, 0, 0.3); }
    100% { transform: translateY(-50%) scale(1); }
}

.value-changed {
    animation: pulse 0.6s ease !important;
}

.performance-visualization {
    margin: 2rem 0;
    width: 100%;
    height: 200px;
    position: relative;
}

#performanceChart {
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}