/*
 * main.css
 * This file contains the primary styling for the Flask application.
 *
 * It includes:
 * - General body, header, main, and footer styles.
 * - Form and button styling for a consistent look.
 * - Flash message styling for user feedback.
 * - Account page styling.
 * - Custom font-face rules for Fredoka and Google Sans Code.
 * - New CSS rules for the recipe card layout based on user's requests.
 */

/* ==================
   Custom Fonts
   ================== */
/*
 * The @font-face rule is used to load custom font files.
 * The paths are relative to this CSS file's location in `static/css/`.
 * font-display: swap; tells the browser to use a fallback font while the custom font is loading,
 * then swap it in once it's ready, improving user experience.
 */


/* ==================
   General Layout & Typography
   ================== */
body {
    /* Use Fredoka as the main font for the body, with sans-serif as a fallback */
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
}

header {
    background-color: #d11a2a; /* Firefighter red */
    color: white;
    padding: 1em 0;
    text-align: center;
}
header nav a {
    color: white;
    text-decoration: none;
    margin: 0 1em;
    font-weight: bold;
    /* Using Fredoka for nav links for consistency */
    font-family: 'Inter', sans-serif;
}
main {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
footer {
    text-align: center;
    padding: 1em 0;
    background-color: #333;
    color: white;
    position: relative;
    bottom: 0;
    width: 100%;
}
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* ==================
   Content Sections & Forms
   ================== */
.content-section {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 1rem;
}
.form-control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    /* Using Fredoka for form controls for a consistent look */
    font-family: 'Inter', sans-serif;
}
.form-control-lg {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
}
.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn-primary {
    color: #fff;
    background-color: #d11a2a; /* Firefighter red */
    border-color: #d11a2a;
}
.btn-primary:hover {
    color: #fff;
    background-color: #b00f1c;
    border-color: #a80e1a;
}
.text-danger {
    color: #dc3545 !important;
    font-size: 0.875em;
}

/* ==================
   Utility Classes & Reusable Components
   ================== */
.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}
.mb-4 {
    margin-bottom: 1.5rem !important;
}
.ml-2 {
    margin-left: 0.5rem !important;
}
.pt-3 {
    padding-top: 1rem !important;
}
.border-top {
    border-top: 1px solid #dee2e6 !important;
}
.text-muted {
    color: #6c757d !important;
}
/* Flash Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}
.media {
    display: flex;
    align-items: center; /* Vertically align items */
}
.media-body {
    margin-left: 20px; /* Space between image and text */
}
.account-img {
    height: 125px;
    width: 125px;
    margin-right: 20px;
    margin-bottom: 16px;
    border-radius: 50%; /* Makes image circular */
    object-fit: cover; /* Ensures image covers area without distortion */
}
.account-heading {
    font-size: 2.5rem;
    margin-bottom: 5px;
    /* Use Fredoka for account headings */
    font-family: 'Inter', sans-serif;
}
.pre-wrap {
    white-space: pre-wrap;
}
.btn-submit-recipe {
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin-top: 30px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.btn-submit-recipe:hover {
    background-color: #c82333;
}
.form-group {
    margin-bottom: 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================
   Recipe Card Specific Styles
   ================== */
.recipe-card {
    background-color: #fff;
    border-radius: 1rem; /* More rounded corners for a casual feel */
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recipe-header-small {
    font-size: 1.25rem; /* Larger than a standard h5 for emphasis */
    font-weight: bold;
    color: #343a40; /* Dark gray for headers */
    font-family: 'Inter', sans-serif;
}

.recipe-description {
    font-size: .9rem; /* Slightly smaller than headers, but larger than base text */
    line-height: 1.6;
    color: #555;
    font-family: 'Inter', monospace; /* Use a monospaced font for description for a unique look */
}

/* New container for a side-by-side layout */
.recipe-details-container {
    display: flex;
    gap: 20px; /* Space between the two columns */
    margin-bottom: 20px;
}

.framed-section {
    border: 2px solid #dee2e6; /* A slightly thicker border */
    border-radius: 0.75rem; /* Consistent rounded corners */
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa; /* Light gray background for frames */
    flex: 1; /* This makes the boxes grow to fill the available space equally */
}

/* Media query for responsiveness: stack columns on small screens */
@media (max-width: 768px) {
    .recipe-details-container {
        flex-direction: column;
    }
}

.framed-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem; /* Make the section headers stand out */
}

.bottom-meta {
    font-size: 0.85rem;
    color: #6c757d;
    text-align: right; /* Align this entire section to the right */
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    margin-top: 2rem;
}

.badge.bg-light {
    background-color: #e9ecef !important;
    color: #6c757d !important;
}

.embed-responsive-16by9 {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.embed-responsive-16by9 iframe,
.embed-responsive-16by9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==================
   Pagination Styles
   ================== */
.pagination .page-item.active .page-link {
    background-color: #d11a2a;
    border-color: #d11a2a;
    color: white;
}

.pagination .page-link {
    color: #d11a2a;
}

.pagination .page-link:hover {
    color: #b00f1c; 
    background-color: #e9ecef;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
}

