/* === A PROFESSIONAL MAKEOVER BY CALY & PARTNER === */

/* --- 1. GLOBAL RESET & NEW COLOR/FONT VARIABLES --- */
:root {
    --primary-dark: #2c3e50;  /* Dark Blue/Charcoal */
    --primary-accent: #f1c40f;  /* STI Vibrant Yellow */
    --primary-light: #ffffff;
    --text-dark: #333333;
    --text-light: #ecf0f1;   /* A soft white */
    --background-color: #f4f6f9; /* Clean, light grey background */
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: var(--background-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Candal', sans-serif;
    color: var(--text-dark);
    margin: 5px;
}

a {
    text-decoration: none;
    color: inherit;
}

.clearfix::after {
    content: '';
    display: block;
    clear: both;
}

/* --- 2. MODERN & UNIFIED BUTTONS --- */
.btn {
    padding: .6rem 1.2rem;
    background: var(--primary-accent);
    color: var(--primary-dark);
    border: 2px solid var(--primary-accent);
    border-radius: 50px; /* Pill-shaped buttons are very modern */
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Candal', sans-serif;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.btn-big {
    padding: .8rem 1.5rem;
    line-height: 1.5rem;
}

.btn:hover {
    background: transparent;
    color: var(--primary-accent) !important;
}

/* --- 3. CLEAN FORMS & MESSAGES --- */
.text-input {
    padding: .8rem 1rem;
    display: block;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    outline: none;
    color: var(--text-dark);
    line-height: 1.5rem;
    font-size: 1.1em;
    font-family: sans-serif;
}
.text-input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.25);
}

.msg {
    width: 100%;
    margin: 10px auto;
    padding: 12px;
    border-radius: 8px;
    list-style: none;
    border: 1px solid transparent;
}
.success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}
.error {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}


/* --- 4. PROFESSIONAL HEADER --- */
header {
    background: var(--primary-dark);
    height: 70px;
    border-bottom: 4px solid var(--primary-accent);
    z-index: 100;
    position: relative;
}

header * {
    color: var(--text-light);
}

header .logo {
    float: left;
    height: inherit;
    margin-left: 2em;
}

header .logo-text {
    margin: 12px;
    font-family: 'Candal', sans-serif;
    font-size: 1.8em;
}

header .logo-text span {
    color: var(--primary-accent); /* The yellow accent */
    font-style: italic;
}

header .nav {
    float: right;
    margin: 0;
    padding: 0;
    list-style: none;
}

header .nav li {
    float: left;
    position: relative;
}

header .nav li a {
    position: relative;
    display: block;
    padding: 23px 25px;
    font-size: 1.1em;
    font-weight: 500;
    transition: color 0.3s ease-out;
}
header .nav li a:hover {
    color: var(--primary-accent);
}
header .nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
header .nav li a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

header .nav li ul { /* Dropdown menu */
    position: absolute;
    top: 70px;
    right: 0;
    width: 180px;
    display: none;
    z-index: 101;
    background: var(--primary-light);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
header .nav li:hover ul {
    display: block;
}
header .nav li ul li {
    width: 100%;
}
header .nav li ul li a {
    padding: 15px;
    color: var(--text-dark);
}
header .nav li ul li a:hover {
    background: #f0f0f0;
    color: var(--primary-accent);
}
header .nav li ul li a.logout {
    color: #e74c3c;
}

header .menu-toggle {
    display: none;
}

/* --- 5. PAGE STRUCTURE & LAYOUT --- */
.page-wrapper {
    min-height: calc(100% - 70px - 350px); /* Full height minus header and footer */
}

/* --- MAIN CONTENT & SIDEBAR --- */
.content {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    display: flex;
    gap: 30px;
}

.content .main-content {
    flex: 3; /* Main content takes up 3/4 of space */
}
.content .main-content.single {
    background: var(--primary-light);
    padding: 20px 40px;
    font-size: 1.1em;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.content .main-content .post-title {
    text-align: center;
    margin-bottom: 40px;
}
.content .main-content .post {
    margin-bottom: 30px;
    border-radius: 8px;
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
}

.content .main-content .post .post-image {
    width: 40%;
}
.content .main-content .post .post-image img {
    width: 100%;
    height: 270px;
    object-fit: cover;
}

.content .main-content .post .post-preview {
    width: 60%;
    padding: 20px;
}

.content .sidebar {
    flex: 1; /* Sidebar takes up 1/4 of space */
}
.content .sidebar .section {
    background: var(--primary-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.content .sidebar .section .section-title {
    font-size: 1.5rem;
}

/* --- 6. PROFESSIONAL FOOTER --- */
.footer {
    background: var(--primary-dark);
    color: var(--text-light);
    position: relative;
    border-top: 4px solid var(--primary-accent);
}

.footer .footer-content {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.footer .footer-section {
    flex: 1;
    padding: 25px;
}
.footer .footer-content h1, .footer .footer-content h2 {
    color: var(--primary-light);
}
.footer .footer-content .about h1 span {
    color: var(--primary-accent);
}
.footer .footer-content .about .contact span, .footer .footer-content .links ul a {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    transition: all 0.3s;
}
.footer .footer-content .links ul a:hover {
    color: var(--primary-accent);
    padding-left: 10px;
}
.footer .footer-content .contact-form .contact-input {
    background: #3a506b;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5rem;
    padding: .9rem 1.4rem;
    border: 1px solid #5b6e82;
    border-radius: 8px;
    width: 100%;
}
.footer .footer-content .contact-form .contact-input:focus {
    background: #4b627f;
}

.footer .footer-bottom {
    background: #1c2833; /* Even darker for the bottom bar */
    color: #a0b2c3;
    height: 60px;
    width: 100%;
    text-align: center;
    padding-top: 20px;
}

/* --- 7. YOUR RESPONSIVE QUERIES - Untouched, they are great! --- */
/* (Keeping all your @media rules as they were) */

@media only screen and (max-width: 934px){
    .content{
        width: 100%;
        flex-direction: column;
    }
    .auth-content{ width: 50%; }
    .content .main-content{ width: 100%; padding: 10px; }
    .content .main-content .post{ width: 100%; }
    .content .sidebar{ width: 100%; padding: 10px; }
    .content .sidebar .section.search{ margin-top: 30px; }
    .footer .footer-content { flex-direction: column; }
    .footer .footer-content .contact-form{ padding-bottom: 90px; }
    .footer .footer-content .contact-form .contact-btn{ width: 100%; }
}
@media only screen and (max-width: 770px){
    header{ position: relative; }
    .auth-content{ width: 60%; }
    header .nav{
        width: 100%;
        background: var(--primary-dark);
        position: absolute;
        top: 70px;
        left: 0;
        max-height: 0px;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    header .nav.showing{
        max-height: 100em;
    }
    header .nav li { width: 100%; }
    header .nav li ul{ position: static; display: block; width: 100%; }
    header .nav li ul li a{
      padding-left: 50px;
      background: #273748; /* Slightly lighter for dropdown */
    }
    header .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 22px;
        font-size: 1.9em;
        cursor: pointer;
    }
}
@media only screen and (max-width: 600px){
    .content .main-content .post { flex-direction: column; }
    .auth-content{ width: 90%; }
    .content .main-content.single{ padding: 10px 20px; }
    .content .main-content .post .post-image{ width: 100%; }
    .content .main-content .post .post-preview{ width: 100%; }
}
/* 🔥 ADDED STYLING FOR .post-info SPAN */
.post-info i {
    font-family: 'Font Awesome 5 Free';
}

.post-info span {
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 0.95em;
    color: #333;
    letter-spacing: 0.3px;
}


.author {
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 0.95em;
    color: #333;
    letter-spacing: 0.3px;
}

.author::before {
    content: "\f007"; /* Font Awesome user icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 5px;
}


/*
=================================
8. SINGLE POST PAGE STYLES
=================================
*/
.single-post-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}
.main-content-single {
    flex: 2; /* Main image and body take up 2/3 */
}
.sidebar-single {
    flex: 1; /* Details box takes up 1/3 */
}
.post-image-container {
    width: 100%;
    max-height: 600px; /* The image container will never be taller than 600px */
    margin-bottom: 20px;
    background-color: #f0f0f0; /* A background color for if an image is loading/missing */
    display: flex; /* These two lines center the image */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* This is important! */
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.post-image-container img {
    width: auto; /* The image's width will adjust */
    height: auto; /* The image's height will adjust */
    max-width: 100%; /* It can never be wider than its container */
    max-height: 100%; /* It can never be taller than its container */
    object-fit: contain; /* This ensures the whole image is visible without being stretched or cropped */
}
.post-body {
    background: var(--primary-light);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    line-height: 1.8;
}

.post-details-box {
    background: var(--primary-light);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: sticky; /* Makes it stay in view on scroll */
    top: 20px;
}
.post-details-box .post-title {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: left;
    font-size: 2.2rem;
}
.details-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.1em;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.details-item:last-child {
    border-bottom: none;
}
.details-item i {
    color: var(--primary-accent);
    font-size: 1.5rem;
    width: 25px;
    text-align: center;
}
.turn-over-form {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.ai-recommendations .section-title {
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

/* Responsive adjustment for single page */
@media only screen and (max-width: 934px) {
    .single-post-container {
        flex-direction: column;
    }
}


.page-header {
    background: var(--primary-light);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
}
.page-header .page-title {
    font-size: 3rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
}
.search-container {
    max-width: 600px;
    margin: 0 auto;
}
.search-container form {
    display: flex;
    gap: 10px;
}
.search-container .text-input {
    flex-grow: 1; /* The search box will take up available space */
}
.search-container .btn {
    flex-shrink: 0; /* The button won't shrink */
}

.results-title {
    font-family: 'Candal', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.post-card-location {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.post-card-location i {
    color: var(--primary-accent);
}

.no-results-card {
    grid-column: 1 / -1; /* Make this card span the full width of the grid */
    text-align: center;
    padding: 50px;
    background: var(--primary-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.no-results-card h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}
.no-results-card p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
}

/* CSS for the new "Report Item" button */
.page-actions {
    margin: 2rem 0;
    text-align: center;
}

.btn-post-new {
    background: #007bff;
    color: white !important;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.btn-post-new:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.btn-post-new i {
    margin-right: 10px;
}


/* ================== NEW AUTHENTICATION PAGE STYLES ================== */

/* This creates the full-page container that centers the form vertically and horizontally */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f7f6; /* A very light, professional grey */
    padding: 2rem;
}

/* This styles the form "card" itself */
.auth-content {
    width: 100%;
    max-width: 450px; /* Prevents the form from stretching on wide screens */
    background: #fff;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e7e7e7;
}

/* Styles for the new header inside the card */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header img {
    max-width: 100px; /* Or whatever size looks best for your logo */
    margin-bottom: 1rem;
}

/* Modern styling for the form title */
.form-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
    color: #333;
}

/* Override existing label styles for better spacing and look */
.auth-content label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* A more modern look for the input fields */
.auth-content .text-input {
    display: block;
    width: 100%;
    height: auto; /* Let padding define the height */
    padding: 12px 15px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.auth-content .text-input:focus {
    outline: none;
    border-color: #0056b3; /* STI's primary blue color for focus */
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* Small helper text style for the email requirement */
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* Style the submit button */
.auth-content .btn-big {
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
    border-radius: 8px;
    background: #ffc107; /* STI Yellow */
    color: #212529; /* Dark text for better contrast on yellow */
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: background-color 0.3s ease;
}

.auth-content .btn-big:hover {
    background: #e0a800; /* A darker yellow for hover */
}

/* Style the "Or Sign In / Or Sign Up" link */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.auth-link a {
    color: #0056b3; /* STI Blue */
    font-weight: 500;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Remove default margin from the form for cleaner layout */
.auth-content form {
    margin: 0;
}