/* --- Global Styles & Variables --- */

:root {
    --primary-bg: #1A1A1A;
    --secondary-bg: rgba(44, 44, 44, 0.9);
    --accent-color-1: #FF3366;
    --accent-color-2: #33CCFF;
    --accent-color-3: #FFEE00;
    --text-color: #E0E0E0;
    --secondary-text: #A0A0A0;
    --border-color: rgba(74, 74, 74, 0.8);
    --input-bg: #3A3A3A;
}


body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    font-size: 200%; 
}

/* --- Background Image --- */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2;
    background-image: url('/static/images/mountain_peak.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

/* --- Floating Geometric Shapes (UPDATED) --- */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    opacity: 0.25;
}

.background-shapes div {
    position: absolute;
    animation: float 25s infinite ease-in-out alternate;
}

.shape-1 { width: 300px; height: 300px; background-color: var(--accent-color-1); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); top: 5%; left: -10%; animation-delay: 0s; }
.shape-2 { width: 400px; height: 200px; background-color: var(--accent-color-2); clip-path: polygon(0% 25%, 100% 0%, 100% 75%, 0% 100%); bottom: 10%; right: -15%; animation-delay: -5s; }
.shape-3 { width: 250px; height: 250px; background-color: var(--accent-color-3); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); top: 50%; left: -5%; transform: translateY(-50%); animation-delay: -10s; }
.shape-4 { width: 150px; height: 500px; background-color: var(--accent-color-1); clip-path: polygon(0% 0%, 100% 10%, 100% 90%, 0% 100%); top: -10%; right: 5%; animation-delay: -15s; }
.shape-5 { width: 350px; height: 150px; background-color: var(--accent-color-2); clip-path: polygon(0% 0%, 100% 0%, 80% 100%, 20% 100%); bottom: -5%; left: 15%; animation-delay: -20s; }

/* CORRECTED: Animation with longer, more varied travel */
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, -30px) rotate(25deg); }
}

/* --- NEW: Fixed Logo --- */
.logo-container {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 120px;
    height: auto;
    z-index: 100; /* Ensure it's on top of all other content */
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.logo-container:hover {
    opacity: 1;
}

.logo-container img {
    width: 100%;
    height: auto;
}

/* --- Main Content Container --- */
.container {
    background-color: var(--secondary-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    margin: 40px auto; /* Centering for the main content */
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* ... (The rest of your CSS from h1 downwards remains the same) ... */
h1 {
    font-family: var(--font-heading);
    color: var(--accent-color-1); /* Use an accent color for headings */
    text-align: center;
    margin-bottom: 10px;
    font-size: 3em;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7); /* Adds depth */
}

.tagline {
    text-align: center;
    color: var(--secondary-text);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.tagline .tagline-yellow {
    color: var(--accent-color-3); /* This is your yellow */
}

.tagline .tagline-pink {
    color: var(--accent-color-1); /* This is your pink */
}

/* --- Form Styling --- */
.generation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--accent-color-2); /* Use another accent color for labels */
    font-size: 1.05em;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color-1);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.3); /* Subtle glow */
}

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

/* --- Form Row for side-by-side elements --- */
.form-row {
    display: flex;
    gap: 20px;
}

.form-row .half-width {
    flex: 1;
}

/* --- Radio Button Styling --- */
.radio-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--input-bg);
}

.radio-group label {
    color: var(--text-color); /* Lighter text for radio labels */
    margin-bottom: 5px; /* Adjust spacing */
    font-weight: normal;
    font-size: 1em;
    display: inline-block; /* Keep label with its radio button */
    margin-left: 8px;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
    accent-color: var(--accent-color-1); /* Color the radio button itself */
}

/* --- Buttons --- */
.button {
    display: inline-block; /* Allows the button to be centered by its parent */
    width: fit-content;
    padding: 15px 30px;
    background-color: var(--accent-color-1);
    color: var(--primary-bg); /* Dark text on vibrant button */
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 20px;
    align-self: center; /* Center the button in the form */
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
}

.button:hover {
    background-color: #CC2952; /* Slightly darker pink on hover */
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.6);
}

.button.primary {
    background-color: var(--accent-color-1);
    color: var(--primary-bg);
}

/* --- Result Page Specific Styles --- */
.album-art {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border: 3px solid var(--accent-color-2); /* Frame the album art */
}

audio {
    width: 100%;
    margin-top: 30px;
    background-color: var(--input-bg);
    border-radius: 8px;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--input-bg);
    color: var(--text-color);
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: var(--accent-color-1);
}

.lyrics-container {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3); /* Inner shadow for depth */
}

.lyrics-container h2 {
    color: var(--accent-color-3); /* Neon yellow for lyrics heading */
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2em;
}

.lyrics-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-mono); /* Monospace for lyrics */
    color: var(--text-color);
    font-size: 1.05em;
    line-height: 1.8;
}

.download-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 15px; /* Spacing between buttons */
    margin-top: 20px;
}

.download-container .button {
    margin: 0; /* Override default button margin */
    flex-grow: 1; /* Allow buttons to grow and fill space */
    max-width: 250px; /* Max width for individual buttons */
}


/* --- Bridge Page Specific Styles --- */
.loading-container {
    text-align: center;
    padding: 50px;
    background-color: var(--secondary-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.loading-container h2 {
    color: var(--accent-color-1);
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.progress-bar-container {
    width: 80%;
    background-color: var(--input-bg);
    border-radius: 5px;
    height: 15px;
    margin: 20px auto 10px auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color-2);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.status-message {
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--text-color);
    text-align: center; 
}

.loader {
    border: 8px solid var(--input-bg);
    border-top: 8px solid var(--accent-color-1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

/* Add this new style for your loading GIF */
.loading-gif {
    display: block;
    margin: 30px auto;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
}


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

/* --- Error Page Specific Styles --- */
.error-container {
    text-align: center;
    padding: 50px;
    background-color: var(--secondary-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    margin: 40px auto;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.error-container h2 {
    color: var(--accent-color-1);
    font-size: 2.5em;
    margin-bottom: 20px;
}

.error-message {
    color: var(--text-color);
    font-size: 1.1em;
    margin-bottom: 30px;
    white-space: pre-wrap; /* Preserve formatting for error messages */
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
    .tagline {
        font-size: 1em;
    }
    .container, .loading-container, .error-container {
        padding: 25px;
        margin: 20px auto;
    }
    .form-row {
        flex-direction: column;
    }
    .background-shapes div {
        animation: none; /* Disable animation on small screens for performance/simplicity */
        opacity: 0.1;
    }
    .shape-1 { width: 150px; height: 150px; top: 2%; left: -5%; }
    .shape-2 { width: 200px; height: 100px; bottom: 5%; right: -8%; }
    .shape-3 { width: 120px; height: 120px; top: 40%; left: -3%; }
    .shape-4 { width: 80px; height: 250px; top: -5%; right: 2%; }
    .shape-5 { width: 180px; height: 70px; bottom: -2%; left: 8%; }

    body::before { /* Adjust overlay for mobile */
        background-color: rgba(0, 0, 0, 0.8); /* Slightly darker on mobile */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    .button {
        padding: 12px 20px;
        font-size: 1em;
    }
    .download-container .button {
        max-width: 100%; /* Full width buttons on very small screens */
    }
}

/* --- NEW: Static Logo Inside Container --- */
.static-logo {
    display: block;
    width: 80%;
    max-width: 450px;
    margin: 0 auto 20px auto; /* Centers the logo and adds space below */
}

/* --- NEW: Style for disabled input sections --- */
.input-container-disabled {
    opacity: 0.4;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Prevents clicking inside */
}

.input-container-disabled h2 {
    text-decoration: line-through;
}

/* --- NEW: Style for the 'OR' separator --- */
.or-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--secondary-text);
    margin: 20px 0;
    font-weight: bold;
    font-size: 1.1em;
}

.or-separator::before, .or-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.or-separator:not(:empty)::before { 
    margin-right: .5em; 
}

.or-separator:not(:empty)::after { 
    margin-left: .5em; 
}

/* --- Additions for Static Pages --- */

/* Generic h2/h3 for content pages */
h2 {
    color: var(--accent-color-2);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    color: var(--accent-color-3);
    margin-top: 30px;
    margin-bottom: 10px;
}

/* Footer Styling */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: var(--secondary-text);
    border-top: 1px solid var(--border-color);
    width: 100%;
}

footer a {
    color: var(--secondary-text);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-color-1);
    text-decoration: none;
}

.copyright-notice {
    font-size: 0.9rem;
    margin-top: 25px; /* Adds space between the links and the notice */
    opacity: 0.8;
}

/* --- Contact Page Specifics --- */
/* New: Modifier to center all content within the main container */
.container.centered-content {
    text-align: center;
    max-width: 650px; /* Set a comfortable width for the centered content */
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--accent-color-2);
    box-shadow: 0 0 15px rgba(51, 204, 255, 0.4);
}

/* For side-by-side buttons like in the Tip Jar */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px; /* Spacing between buttons */
    flex-wrap: wrap;
    margin-top: 20px;
}

/* This is the key fix for the side-by-side buttons */
.button-group .button {
    display: inline-block; /* Override the default "display: block" */
    width: auto; /* Allow the button to size to its content */
}

/* A simple divider to separate sections */
.contact-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px auto;
    width: 80%;
}

/* --- Additions for Page Enhancements --- */

/* For highlighting key sections in Terms or Licenses */
.highlight-box {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--accent-color-1);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

/* For embedding license text directly on the page */
.license-text {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9em;
    max-height: 250px;
    overflow-y: auto;
}

/* For the confirmation message on the contact form */
#formConfirmation {
    color: var(--accent-color-2);
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    height: 0;
    overflow: hidden;
}

#formConfirmation.visible {
    opacity: 1;
    height: auto;
}

.contact-fallback {
    text-align: center;
    margin-top: 20px;
    color: var(--secondary-text);
}



