/* --- Fluid Gradient Background --- */
:root {
    --ang: 0deg; /* Start at 0 for a seamless loop */
    --c1: #FF9D76;
    --c2: #76F1FF;
    --c3: #C176FF;
    --c4: #FFE176;
    --input-border-color: #ccc;
    --input-focus-color: #76F1FF;
}

html::before {
    content: "";
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: -1;
    background: linear-gradient(var(--ang), var(--c1), var(--c2), var(--c3), var(--c4));
    background-size: 200% 200%;
    animation: bg-pan 18s ease-in-out infinite alternate, bg-rotate 36s linear infinite;
    pointer-events: none;
}

@keyframes bg-pan {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 0%; }
    100% { background-position: 0% 100%; }
}

@keyframes bg-rotate {
    from { --ang: 0deg; } /* Explicitly start at 0 */
    to { --ang: 360deg; } /* End at 360 (visually same as 0) */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: #333;
    padding: 20px;
}

/* --- General Layout & Themed UI --- */
header, .card, main {
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    backdrop-filter: blur(10px); /* Frosted glass effect */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed from center for better responsive control */
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding: 15px 20px;
}

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

.header-logo {
    height: 50px; /* Controls the size of the logo */
}

.header-title {
    margin: 0;
    flex-grow: 1;
}

main { padding: 20px; }

/* --- Modernized Form Fields --- */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--input-border-color);
    background-color: #fff;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px rgba(118, 241, 255, 0.4);
}

/* --- Form Field & Grid styles for modals */
.form-field { margin-bottom: 15px; }
.form-field label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}


/* --- Responsive adjustments --- */
@media (max-width: 992px) {
    .chart-grid {
        grid-template-columns: 1fr; /* Stack charts on smaller screens */
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .header-title {
        font-size: 1.2em; /* Shrink title on small screens */
    }

    .header-logo {
        height: 40px; /* Make logo a bit smaller on mobile */
    }

    #auth-container {
        width: 100%;
    }
    #signout_button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr; /* Single column forms on mobile */
    }
}
