/* static/custom.css */
/* --- Theme Definitions --- */

:root {
    /* Define base values for the retro theme */
    --primary-font: 'Press Start 2P', cursive;
    --background-color: #3d2314;
    --text-color: #f5e8ba;
    --text-color-accent: #f7a553;
    --text-color-inputs: #3d2314;
    --card-background: #7a5032;
    --card-background-light: #8b5e41;
    --card-background-dark: #593a25;
    --card-shadow: 6px 6px 0px #221a13;
    --card-border: 4px solid #3d2314;
    --input-background: #f5e8ba;
    --btn-shadow: 4px 4px 0px #221a13;
    --btn-shadow-hover: 3px 3px 0px #221a13;
    --btn-shadow-active: none;
    --btn-border: 3px solid #3d2314;
    --btn-transform-hover: translate(1px, 1px);
    --btn-transform-active: translate(1px);
    --border-radius: 0;
}

.theme-modern {
    /* Override variables for the modern theme */
    --primary-font: 'Helvetica Neue', 'Arial', sans-serif;
    --background-color: #f4f7f6; /* Light gray background */
    --text-color: #333333; /* Dark gray text */
    --text-color-accent: #007bff; /* Standard blue accent */
    --text-color-inputs: #333333;
    --card-background: #ffffff; /* White cards */
    --card-background-light: #fdfdfd;
    --card-background-dark: #f9f9f9;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Soft shadow */
    --card-border: 1px solid #e0e0e0; /* Thin border */
    --input-background: #ffffff;
    --btn-shadow: none;
    --btn-shadow-hover: none;
    --btn-shadow-active: none;
    --btn-border: 1px solid transparent;
    --btn-transform-hover: translateY(-1px);
    --btn-transform-active: translateY(1px);
    --border-radius: 0.25rem; /* Standard rounded corners */
}

/* --- End Theme Definitions --- */

body {
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: .75em;
    background-image: url('/static/images/cozykitchen.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed; /* This is the key property */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--primary-font);
    color: var(--text-color-accent);
    /* Adjust header sizes relative to the new base font size */
    font-size: 1.8em; /* Original h1 might have been 2.5em, now it's 1.8 of the new base */
    margin-bottom: 0.5em; /* Reduce space below headers */
}
h2 { font-size: 1.5em; }
h3 { font-size: 1.3em; }

hr {
    border-color: rgba(245, 232, 186, 0.3);
    margin-top: 1em; /* Reduce vertical margin */
    margin-bottom: 1em;
}

.page-wrapper {
    /* This is our new container for the site and background image */
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(61, 35, 20, 0.01); /* Dark brown at 80% opacity */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    min-height: 100vh; /* Ensure wrapper fills the screen height */
}

/* --- Container Adjustment --- */
.container {
    max-width: 90%; /* Use a percentage for wider screens */
}


/* --- Recipe Card Styling --- */
.recipe-card {
    background-color: var(--card-background);
    border: var(--btn-border);
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    box-shadow: var(--btn-shadow);
    transition: all 0.1s ease-in-out;
}

.recipe-card:hover {
    background-color: var(--card-background-light);
    cursor: pointer;
}

.recipe-card-checkbox {
    margin-right: 15px; /* Reduced margin */
    width: 20px; /* Smaller checkbox */
    height: 20px;
    min-width: 20px; /* Ensure it stays small */
}

.recipe-card-content {
    flex-grow: 1;
}

.recipe-card-name {
    font-size: 1.1em; /* Slightly larger than base text for emphasis */
    color: var(--text-color);
}

.recipe-card-badges {
    margin-top: 5px; /* Space between name and badges */
}

.recipe-card-link {
    font-size: 0.9em; /* Smaller "View" link */
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 8px; /* Reduced padding */
    border: 2px solid #3d2314;
    background-color: var(--card-background-dark);
    margin-left: 10px; /* Space from badges */
}

.recipe-card-link:hover {
    color: #fff;
    background-color: var(--background-color);
}

/* --- Button and Form Styling --- */
.btn {
    font-family: var(--primary-font);
    border-radius: var(--border-radius);
    border: var(--btn-border);
    box-shadow: var(--btn-shadow);
    text-transform: uppercase;
    color: #fff;
    transition: all 0.1s ease-in-out;
    padding: 8px 12px; /* Adjusted padding */
    font-size: 0.9em; /* Slightly smaller button text */
}

.btn-primary { background-color: #4a6b99; }
.btn-success { background-color: #5d945d; }
.btn-info    { background-color: #4c8a99; }
.btn-secondary { background-color: #6c757d; }

.btn:hover {
    color: #fff;
    transform: var(--btn-transform-hover);
    box-shadow: var(--btn-shadow-hover) 3px 3px 0px #221a13;
}

.btn:active {
    transform: var(--btn-transform-active) translate(4px, 4px);
    box-shadow: none;
}

.card {
    background-color: var(--card-background-dark) !important;
    border: var(--btn-border);
    border-radius: var(--border-radius);
}

.btn-link {
    border: none;
    box-shadow: var(--btn-shadow-active);
    text-decoration: underline;
    color: var(--text-color-accent);
    font-size: 0.9em; /* Consistent with other button text */
}

/* --- Updated Form Control Styling --- */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #3d2314;
    background-color: var(--input-background);
    color: var(--text-color-inputs);
    font-family: var(--primary-font);
    font-size: 0.9em;
    padding: 6px 10px;
}

/* Style the placeholder text (e.g., "Qty", "Unit") */
.form-control::placeholder {
    color: var(--card-background);
    opacity: 1; /* Override browser defaults */
}

/* Style the labels above the inputs */
.form-label {
    color: var(--text-color-accent);
    font-size: 1em; /* Make labels a bit bigger than input text */
}

.form-control:focus, .form-select:focus {
    border-color: var(--text-color-accent);
    box-shadow: 0 0 0 0.1rem rgba(247, 165, 83, 0.5);
    background-color: #ffffff;
}

/* Badge styling */
.badge {
    font-family: var(--primary-font);
    border-radius: var(--border-radius);
    padding: 4px 6px;
    font-size: 0.7em; /* Smaller badge text */
    vertical-align: middle; /* Align with text */
    margin-right: 5px; /* Space between badges */
}

.recipe-instructions-full {
    background-color: var(--card-background);
    border: var(--btn-border);
    box-shadow: var(--btn-shadow);
    padding: 20px;
    margin-top: 20px;
    
    /* This is the key property: */
    /* It respects new lines from your input but also wraps long lines */
    white-space: pre-wrap; 
    text-indent: 0;
}
/* --- Ingredient List Styling (Recipe Page) --- */
.list-group-item {
    background-color: var(--card-background);
    border: var(--btn-border);
    color: var(--text-color);
    padding: 10px 15px;
    /* This negative margin makes the thick borders overlap neatly */
    margin-bottom: -3px; 
}

/* Remove Bootstrap's default rounded corners on the first and last items */
.list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.list-group-item:last-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0; /* No margin on the very last item */
}

/* Add a hover effect for interactivity */
.list-group-item:hover {
    background-color: var(--card-background-light);
    color: #fff;
}
/* --- Grocery List Table Styling --- */
.table {
    border: var(--btn-border);
    box-shadow: var(--btn-shadow);
    border-collapse: separate; /* Needed for borders to work with our theme */
    border-spacing: 0;
}

.table th,
.table td {
    color: var(--text-color) #f5e8ba;
    border: none; /* Remove Bootstrap's thin borders */
    border-top: var(--btn-border);
    vertical-align: middle;
}

.table th {
    /* Style for the table header */
    background-color: var(--card-background-dark);
    color: var(--text-color-accent);
}

.table td {
    /* Style for the table data cells */
    background-color: var(--card-background);
}

/* Style for the themed striped rows */
.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: var(--card-background-light);
    color: var(--text-color);
}

/* Remove the top border from the first row to look cleaner */
.table> :not(caption)>*>* {
    border-top-width: 0;
}
.table>tbody>tr:first-child>* {
    border-top: var(--btn-border);
}

.bg-primary { background-color: #4a6b99 !important; } /* Blue for protein */
.bg-secondary { background-color: #6c757d !important; } /* Gray for season */

/* --- Stats Card Styling --- */
.stats-card {
    background-color: var(--card-background);
    border: var(--card-border);
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.stats-card h4 {
    text-align: center;
    margin-bottom: 15px;
}

.stats-card ul {
    list-style-type: none; /* Removes bullet points */
    padding-left: 10px;
}

.stats-card li {
    margin-bottom: 8px;
}

/* --- Level Up / XP Bar Styling --- */
.level-up-section {
    text-align: center;
    margin-bottom: 15px;
}

.level-display {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: var(--text-color-accent);
}

.xp-bar.progress {
    height: 20px;
    background-color: var(--background-color);
    border: 3px solid #221a13;
    border-radius: 0;
    box-shadow: inset var(--btn-shadow-hover);
    padding: 2px;
}

.xp-bar .progress-bar {
    background-color: #5d945d; /* Green for the XP bar fill */
    border-radius: 0;
}

.xp-display {
    font-size: 0.8em;
    margin-top: 5px;
}

/* Adds extra scroll space at the bottom of the page */
.main-content-area {
    margin-bottom: 15vh; /* Add a margin equal to 15% of the viewport height */
}
/* Print CSS specific overrides for the pixel theme */
@media print {
    body {
        font-size: 10pt; /* Even smaller for print */
    }
}
    h1, h2, h3 {
        color: var(--text-color) !important; /* Ensure print readability */
        font-size: 1.2em !important; /* Added a value and semicolon */
}
/* --- Custom File Input Styling --- */
.file-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.real-file-input {
    /* Hide the real input but keep it functional */
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}
.file-info {
    margin-left: 15px;
    color: var(--text-color); /* Use our light theme color */
    align-self: center; /* Helps with vertical alignment */
}
/* Fixes text color for 'empty' messages in cards */
.card-body > p {
    color: var(--text-color); /* Use our light theme color */
}
/* Fixes text color for filter checkboxes */
.form-check-label {
    color: var(--text-color); /* Use our light theme color */
}
/* Fixes text color for titles and lists inside cards */
.card-body .card-title {
    color: var(--text-color-accent); /* Ensures card titles use our orange accent color */
}

.card-body ul li {
    color: var(--text-color);
}
.card-body span {
    color: var(--text-color);
}
/* Fixes text color for card headers on the planner page */
.card-header {
    background-color: var(--card-background-dark);
    color: var(--text-color);
    border-bottom: var(--btn-border);
}
/* Styles the category titles on the grocery list */
table caption {
    caption-side: top; /* Ensures caption is at the top of the table */
    font-family: var(--primary-font);
    color: var(--text-color-accent);
    font-size: 1.3em;
    text-align: left;
    padding: 0;
    margin-bottom: 0.5em;
}
/* --- Mobile-Specific Fixes for Smoother Scrolling ---*/
@media (max-width: 768px) {
    body {
        /* On mobile, let the background scroll with the page instead of being fixed. */
        /* This prevents the jarring resize when the URL bar appears/disappears. */
        background-attachment: scroll;
        /* Set a different, tileable background for mobile */
        background-image: none;
        background-color: var(--background-color);
    }
}
/* --- Timer Styling --- */
.timer-display {
    position: relative;
    background-color: #221a13; /* Very dark background */
    border: var(--card-border);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.timer-label {
    font-size: 1em;
    margin-bottom: 10px;
    display: block;
    word-wrap: break-word;
}

.timer-time {
    font-size: 2em;
    color: var(--text-color-accent);
    letter-spacing: 4px;
    text-align: center;
}

.timer-progress-bar {
    height: 10px;
    background-color: var(--background-color);
    width: 100%;
    margin-top: 10px;
    border: 2px solid #221a13;
}

.timer-progress-fill {
    height: 100%;
    width: 100%;
    background-color: #5d945d; /* Green for the progress fill */
    transition: width 1s linear; /* Smooth transition for the bar */
}
/* Makes the main header link interactive on hover */
.navbar-brand:hover {
    color: #fff; /* Make it a brighter white on hover */
    transition: color 0.2s ease-in-out; /* Add a smooth transition effect */
}
.text-overlay {
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    margin: 0 auto 20px auto; /* Center the block and add space below */
}
.text-overlay-left {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px; /* Keep the space below */
}
@media (min-width: 1201px) {
    body {
        /*
        Overrides 'background-size: cover' on ultrawide monitors.
        Sets the background image width to a fixed 1400px and adjusts
        the height automatically to maintain the aspect ratio.
        */
        background-size: 1300px auto;
    }
}
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: WHITE;
  background-image: none;
  border: 1px solid #747775;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color .218s, border-color .218s, box-shadow .218s;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity .218s;
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
  border-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state, 
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 8%;
}
/* Styles for the new cooking temps list */
.temp-guide-list {
    list-style-type: none; /* Removes bullet points */
    padding-left: 0;
    color: var(--text-color); /* Use our theme variable */
}
.temp-guide-list li {
    margin-bottom: 5px;
}
.temp-guide-list li strong {
    color: var(--text-color-accent); /* Use our accent color for headers */
}