/* --- Global Styles and Reset --- */
:root {
    --primary-color: #7986cb; /* Light Indigo for main accents and links */
    --secondary-color: #ffb74d; /* Light Orange/Amber for highlights */
    --background-color: #121212; /* Deep Charcoal Black background */
    --card-background: #1e1e1e; /* Slightly lighter dark gray for cards */
    --text-color: #e0e0e0; /* Off-White/Light Gray for body text */
    --border-color: #333333; /* Darker gray for subtle borders/dividers */
    --success-color: #a5d6a7; /* Light Green for success */
    --warning-color: #ffd54f; /* Light Yellow for warnings */
    --error-color: #ef9a9a; /* Light Red for errors/stops */
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Container and Layout --- */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    background-color: var(--card-background);
    text-align: center; 
}

/* --- H1 Styles (Removed gradient from global H1) --- */
h1 {
    font-weight: 900; 
    font-size: 2.2em; 
    margin-top: 0;
    padding-bottom: 15px; 
    border-bottom: 2px solid var(--primary-color); 
    /* NEW: Use the default text color globally for H1 */
    color: var(--text-color); 
}

/* 1. Analysis Tool Title (FINAL FIX: Match light gray) */
#analyzer h1 {
    /* REMOVE ALL GRADIENT AND TRANSPARENCY PROPERTIES */
    background: none !important; /* Force removal of background */
    -webkit-background-clip: unset !important; /* Force removal of clip */
    
    /* Set color explicitly, overriding any previous transparent setting */
    -webkit-text-fill-color: var(--text-color) !important; 
    background-clip: unset !important;
    text-fill-color: unset !important;
    
    /* Ensure the solid color is explicitly set to the desired light gray */
    color: var(--text-color) !important; 
}


/* 2. Profile Tab Title (Keep Light Gray) */
#profile h1 {
    /* Use the default text color (Light Gray) for the Profile tab */
    color: var(--text-color); 
    
    /* Ensure no gradient is applied */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--text-color); 
    background-clip: unset;
    text-fill-color: unset;
    
    /* Ensure the color is set to the variable */
    color: var(--text-color); 
}


h2 {
    color: var(--text-color);
    font-size: 1.4em;
    font-weight: 600;
    padding: 10px 0;
    margin-top: 20px;
}

h3 {
    color: var(--text-color);
    font-size: 1.2em;
    font-weight: 500;
    margin-top: 15px;
}

/* Style for the 'Uploaded Image' heading */
#imagePreview h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color); 
}

/* --- Tab Navigation --- */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    flex-grow: 1;
    padding: 12px;
    font-size: 1.1em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}

/* --- Tab Content Display Logic --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Card Styles (Standard Container for Profile and Form) --- */
.card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* --- Input and File Loader --- */
input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    background-color: #2c2c2c;
    color: var(--text-color);
    text-align: left; 
}

/* STYLED CUSTOM UPLOAD BUTTON (Fix: Made button smaller and centered) */
#customFileButton {
    background-color: var(--secondary-color);
    color: var(--background-color);
    display: block; 
    /* CHANGED: Removed 100% width and used max-width for size control */
    max-width: 250px; 
    /* NEW: Added auto margins to center the block element */
    margin: 20px auto; 
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

#customFileButton:hover {
    background-color: #ffc272; 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* Hide the native file input (Part of the button fix) */
input[type="file"] {
    display: none;
}

/* FIX 1: Profile Photo Upload Button (using the new ID) */
#profileUploadButton {
    background-color: var(--secondary-color);
    color: var(--background-color);
    display: block;
    max-width: 100%; 
    margin: 15px auto;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

#profileUploadButton:hover {
    background-color: #ffc272; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* --- Action Buttons --- */
.action-button {
    /* Kept 100% width for the other action buttons */
    width: 100%;
    padding: 12px 20px;
    margin-top: 10px;
    /* FIX 3: Added bottom margin to prevent button stacking/overflow */
    margin-bottom: 10px; 
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    
    /* CRITICAL FIX: Ensure padding/border are included in the 100% width */
    box-sizing: border-box; 
}

#saveProfileButton, #editProfileButton {
    background-color: var(--primary-color);
    color: var(--background-color);
}

#resetButton {
    background-color: var(--secondary-color);
    color: var(--background-color);
}

#cancelEditButton {
    background-color: var(--border-color);
    color: var(--text-color);
    /* margin-top: 5px; - Removed margin-top here as it is handled by .action-button */
}

.action-button:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* --- Analysis Results STYLING (The New Boxes) --- */

#results {
    margin-top: 30px;
}

/* 1. Grid Container for Tonal Diagnostics */
.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

/* 2. Individual Metric Box */
.metric-box {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 0.9em;
    text-align: center; 
}

.metric-box strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 1em;
}

.metric-box p {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
    color: var(--text-color);
}

.metric-box small {
    display: block;
    color: #999;
    margin-top: 5px;
}

/* Metric Status Colors */
.metric-box.warning {
    border-left: 4px solid var(--warning-color);
}
.metric-box.success {
    border-left: 4px solid var(--success-color);
}


/* 3. Suggestion Boxes (Full Width) */
#suggestionsOutput h4 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.suggestion-box {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid var(--border-color);
    text-align: left; 
}

.suggestion-box.error {
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.suggestion-box.warning {
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.suggestion-box.success {
    border-left-color: var(--success-color);
    color: var(--text-color);
}

.suggestion-box strong {
    color: var(--secondary-color);
}

/* Fix for status message color */
#statusMessage {
    font-weight: bold;
    color: var(--primary-color);
}

/* Dedicated class for the static disclaimer box */
.analysis-disclaimer-card {
    padding: 10px;
    border-left: 5px solid var(--secondary-color); 
    margin-bottom: 20px;
}

/* The static disclaimer box */
#analysisDisclaimer {
    text-align: center;
}


.card hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 15px 0;
}

/* --- Profile Specific Styles (Adjusted for Dark Mode) --- */
.profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid var(--secondary-color);
}

#profileHeader {
    text-align: center;
}

#profileHeader h2 {
    margin: 5px 0 15px 0;
}

/* Gallery for Uploaded Photos */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    padding-top: 10px;
}

.gallery-item {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

/* Average Stats Styling */
#averageStats p {
    border: none;
    padding: 5px 0;
    text-align: center;
}

/* --- DISCORD BUTTON STYLES ADDED BELOW --- */
.discord-button {
  /* Set the image as the background, using the file name you provided */
  background-image: url('1000032403.png');
  background-size: cover; /* Ensures the image covers the area */
  background-repeat: no-repeat;
  
  /* Set the size of the button */
  width: 50px;
  height: 50px;
  
  /* Display and Centering: This is crucial to position it below the H1 */
  display: block; 
  margin: 10px auto 25px auto; /* Centers the button and adds vertical space */
  
  /* Make it circular (Discord style) */
  border-radius: 50%;
  
  /* Optional: Hover effect for interactivity */
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.discord-button:hover {
  opacity: 0.8; /* Dims the button slightly on hover */
  transform: scale(1.05); /* Gives a slight 'pop' effect */
}

/* Netlify Cache Buster Fix: Forces a fresh deploy to recognize the new PNG icon names */
/* This comment can be removed after the next successful deploy. */
