:root {
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --on-surface: #e1e1e1;
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--on-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, #2c1a3d 0%, #121212 100%);
    z-index: -1;
}

.container {
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: white;
    font-size: 1rem;
    outline: none;
    width: 300px;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

button {
    background: var(--primary-color);
    color: #121212;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.4);
}

.loader {
    display: none;
    margin: 2rem auto;
    width: 48px;
    height: 48px;
    border: 5px solid rgba(187, 134, 252, 0.1);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#canvas-container {
    overflow-x: auto;
    margin-top: 2rem;
    padding-bottom: 1rem;
}

#grassCanvas {
    display: block;
    margin: 0 auto;
}

#tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    pointer-events: none;
    display: none;
    z-index: 1000;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="text"] {
        width: 100%;
        box-sizing: border-box; /* Ensure padding doesn't affect width */
    }

    button {
        width: 100%;
    }
}

/* Toggle Switch */
.controls-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 10px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--on-surface);
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-right: 10px;
    transition: 0.3s;
    border: 1px solid var(--glass-border);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #adb5bd;
    top: 1px;
    left: 2px;
    transition: 0.3s;
}

.toggle-input:checked + .toggle-slider {
    background-color: rgba(187, 134, 252, 0.3);
    border-color: var(--primary-color);
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background-color: var(--primary-color);
}

.toggle-label {
    opacity: 0.8;
    transition: 0.3s;
}

.toggle-input:checked ~ .toggle-label {
    opacity: 1;
    color: var(--primary-color);
    font-weight: 500;
}
