:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --background-color: #f4f4f9;
    --text-color: #333;
    --error-color: #e74c3c;
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

main {
    flex: 1;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 2rem;
}

.file-input-container {
    margin-bottom: 1rem;
}

input[type="file"] {
    display: none;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

#fileName {
    margin-left: 10px;
    font-style: italic;
}

.error {
    color: var(--error-color);
    margin-top: 10px;
}

.chart-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-controls {
    margin-bottom: 1rem;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.color-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    margin: 0 2px;
    transition: transform 0.1s;
}

.color-btn:hover {
    transform: scale(1.2);
}

.canvas-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.ad-container {
    margin-top: 2rem;
    text-align: center;
}

.ad-placeholder {
    background-color: #e0e0e0;
    color: #888;
    padding: 20px;
    border: 1px dashed #aaa;
    border-radius: var(--border-radius);
    max-width: 728px; /* Leaderboard size */
    margin: 0 auto;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

footer a {
    color: #bdc3c7;
    text-decoration: none;
}

footer a:hover {
    color: white;
}

.hidden {
    display: none !important;
}

#colorControls {
    display: inline-block;
    margin-left: 10px;
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .chart-controls > * {
        margin-bottom: 10px;
        margin-left: 0 !important;
    }
    
    #colorControls {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .canvas-container {
        height: 300px;
    }
    
    .upload-section, .chart-section {
        padding: 1rem;
    }
}
