/* --- Global Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
    /* Using the new sleek font */
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff; /* Pure white */
    color: #111; /* Almost black */
    -webkit-font-smoothing: antialiased;
}

/* --- Header & Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed; /* Keeps header at the top when scrolling */
    width: 100%;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

nav a {
    text-decoration: none;
    color: #111;
    margin-left: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #777;
}

/* Update the nav to use flexbox for perfect alignment */
nav {
    display: flex;
    align-items: center;
}

/* The container for the login info */
.auth-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 30px;
    padding-left: 30px;
    border-left: 1px solid #ddd; /* Adds a clean vertical separator line */
}

/* The "Logged in as: Shane" text */
.user-greeting {
    font-size: 0.75rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-greeting strong {
    color: #111;
    font-weight: 700;
}

/* The sleek logout button */
.logout-btn {
    background-color: transparent;
    color: #777;
    border: 1px solid #ddd;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    color: #111;
    border-color: #111;
}

/* --- Hero Section --- */
.hero {
    /* Massive edge-to-edge image */
    height: 90vh; 
    background: linear-gradient(rgba(0, 20, 38, 0.75), rgba(0, 0, 0, 0.6)), 
                url('https://static.americasbestracing.net/s3fs-public/styles/large_hero_16_9/public/article/z20241102_charles%20toler_eclipsesportswire_13535.jpg?itok=at6Zv8Zp&c=78c9eab378dc95c158e153fdfc81989d') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content h2 {
    font-size: 4rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 30px;
}

.hero-btn {
    background-color: transparent;
    color: white;
    border: 3px solid white;
    padding: 12px 40px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-btn:hover {
    background-color: white;
    color: black;
}

/* --- Filters Section --- */
.filters-wrapper {
    max-width: 1400px;
    margin: 40px auto 0 auto;
    border-bottom: 1px solid #eee;
}

.filters-toggle {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    justify-content: center; /* Centers the button text */
    align-items: center;
    gap: 10px;
    padding: 10px 0 10px 0;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    color: #111;
    transition: background-color 0.3s;
}

.chevron {
    transition: transform 0.3s ease; /* Makes the arrow spin smoothly */
}

/* This class flips the arrow upside down when the menu is open */
.filters-toggle.active .chevron {
    transform: rotate(180deg);
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    background-color: #ffffff;
    
    /* These three lines handle the smooth sliding animation */
    max-height: 0; 
    padding: 0 40px; 
    overflow: hidden; 
    transition: max-height 0.4s ease, padding 0.4s ease;
}

/* This class expands the menu when added by JavaScript */
.filters-container.open {
    max-height: 500px; /* Arbitrary large number to let it expand fully */
    padding: 40px; 
}

/* ... Keep all your existing .filter-group, .checkbox-group, and button styles exactly the same below here! ... */
.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: #777;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    accent-color: #111; 
    width: 14px;
    height: 14px;
}

.filter-action {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-bottom: 8px; 
}

.filter-btn {
    background-color: #f4f4f4;
    color: #111;
    border: none;
    padding: 10px 30px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-btn:hover {
    background-color: #e0e0e0;
}

.clear-btn {
    background-color: transparent;
    color: #777;
    border: none;
    padding: 0;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: underline;
    visibility: hidden; 
    opacity: 0; 
    transition: opacity 0.3s ease, color 0.3s;
}

.clear-btn:hover {
    color: #111;
}

/* --- Horse Listings Grid --- */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    padding: 60px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background-color: #fff;
    border-radius: 16px; /* Brings back the rounded corners */
    overflow: hidden; /* Ensures the horse images stay inside the rounded corners */
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); /* Brings back the soft, floating shadow */
    display: flex;
    flex-direction: column;
    border: none; /* Removes the flat line border */
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease; /* Adds a smooth animation for hover */
	opacity: 1;
	transform: scale(1);
}

/* Optional: Adds a nice floating effect when the user hovers over a horse */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.card.fade-out {
	opacity: 0;
	transform: scale(0.8);
}

.card-content {
    padding: 18px; /* Brings back the padding so the text doesn't touch the edges */
}

.card-img {
    height: 250px;
    width: 100%;
    background-size: cover;
    background-position: center;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.specs {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
}

.details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9rem;
    margin-bottom: 25px;
    color: #333;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.price {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
}

.time {
    font-size: 0.75rem;
    font-weight: 400;
    color: #777;
    margin-top: 3px;
}

.bid-btn {
    background-color: #111;
    color: white;
    border: 2px solid #111;
    padding: 10px 25px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bid-btn:hover {
    background-color: transparent;
    color: #111;
}

/* --- Footer --- */
footer {
    padding: 13px 13px;
    background-color: #fafafa;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-links a {
    text-decoration: none;
    color: #777;
    font-size: 0.8rem;
    margin: 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Account Page Styles --- */
.account-wrapper {
    max-width: 800px; /* Keeps the form from getting too wide on large screens */
    margin: 0 auto;
    padding: 120px 40px 80px 40px; /* Top padding accounts for the fixed header */
}

.account-header {
    margin-bottom: 40px;
    border-bottom: 2px solid #111;
    padding-bottom: 20px;
}

.account-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #111;
    margin-bottom: 10px;
}

.account-header p {
    color: #777;
    font-size: 0.95rem;
}

.account-form-container {
    background-color: #fff;
}

.form-section {
    margin-bottom: 50px;
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    color: #111;
}

/* 2-Column Grid for Inputs */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Sleek, modern text inputs */
.input-group input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
    color: #111;
    transition: border-color 0.3s;
    outline: none;
    background-color: #fafafa;
}

.input-group input:focus {
    border-color: #111; /* Sharp black border when typing */
    background-color: #fff;
}

.privacy-toggle {
    margin-top: 15px;
    padding: 15px 20px;
    background-color: #fafafa;
    border-left: 3px solid #111;
}

.privacy-toggle label,
.notification-masters label,
.checkbox-grid label {
    font-size: 0.9rem;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style all checkboxes on the account page */
.account-wrapper input[type="checkbox"] {
    accent-color: #111;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notification-masters {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.notification-details h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: #777;
    margin-bottom: 15px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Save Button */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
}

.save-btn {
    background-color: #111;
    color: white;
    border: 2px solid #111;
    padding: 12px 40px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background-color: transparent;
    color: #111;
}

/* --- Horse Profile Page Styles --- */
.profile-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 50px 80px 50px; /* Accounts for the fixed header */
}

.profile-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* Image takes up slightly more space than the text */
    gap: 60px;
    align-items: start;
}

.profile-image-container {
    width: 100%;
}

.profile-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    /* Keeping the image completely square/flat to match the Tesla vibe */
}

.profile-details {
    display: flex;
    flex-direction: column;
}

.profile-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #111;
    padding-bottom: 15px;
}

.profile-header h2 {
    font-size: 3.5rem;
    font-weight: 300;
    color: #111;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-price-block {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.price-main {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
}

.equity-badge {
    background-color: #f4f4f4;
    color: #111;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #ddd;
}

/* Specs List */
.specs-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.spec-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec-value {
    font-size: 1rem;
    font-weight: 500;
    color: #111;
    text-align: right;
}

/* Action Buttons */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.primary-btn {
    width: 100%;
    background-color: #111;
    color: white;
    border: 2px solid #111;
    padding: 10px 0;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background-color: transparent;
    color: #111;
}

.secondary-btn {
    width: 100%;
    background-color: transparent;
    color: #111;
    border: 1px solid #ddd;
    padding: 18px 0;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: #111;
    background-color: #fafafa;
}

/* Make it stack cleanly on smaller screens */
@media (max-width: 900px) {
    .profile-grid {
        display: flex; 
        flex-direction: column;
        gap: 40px;
    }
    
    /* This forces the text to the top on mobile */
    .profile-details {
        order: 1; 
    }
    
    /* This pushes the image and documents below the text */
    .profile-image-container {
        order: 2; 
    }
}

/* --- Documents Accordion Styles --- */
.documents-section {
    margin-top: 20px;
}

.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    padding: 20px 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    cursor: pointer;
    transition: color 0.3s;
}

.accordion-header:hover {
    color: #777;
}

.accordion-header .chevron {
    transition: transform 0.3s ease;
}

.accordion-header.active .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.accordion-content.open {
    max-height: 500px; /* Expands to show the files */
    padding-bottom: 20px;
}

/* Mock File Styling */
.mock-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
    border: 1px solid #ddd;
    padding: 15px 20px;
    margin-top: 10px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.mock-file:hover {
    border-color: #111;
    background-color: #fff;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.file-view {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid #111;
    padding-bottom: 2px;
}

.file-view:hover {
    color: #777;
    border-bottom-color: #777;
}

/* --- Profile Contact Box --- */
.profile-contact-box {
    margin-top: 40px;
    padding: 25px;
    background-color: #fafafa;
    border: 1px solid #eee;
    border-left: 3px solid #111; /* Signature stark black accent line */
}

.profile-contact-box h4 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 10px;
}

.profile-contact-box p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.profile-contact-box strong {
    color: #111;
}

/* Styled to look like a crisp, clickable text link instead of a bulky button */
.email-link {
    display: inline-block;
    color: #111;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-bottom: 2px solid #111;
    padding-bottom: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.email-link:hover {
    color: #777;
    border-bottom-color: #777;
}

/* --- Profile Description Text --- */
.profile-description {
    margin-bottom: 20px; 
    background-color: #fafafa; /* Very subtle light gray background */
    padding: 10px 10px; /* Adds breathing room inside the box */
    border: 1px solid #eeeeee; /* A crisp, faint border to define the edges */
}

.profile-description ul {
    padding-left: 20px; /* Brings back the space for the bullets */
}

.profile-description li {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 8px; /* Spaces the bullet points out nicely */
}

/* --- Profile Disclosure Box --- */
.profile-disclosure {
    margin-bottom: 20px;
    padding: 20px 25px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-left: 3px solid #111; /* Signature black accent line */
}

.profile-disclosure h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 8px;
}

.profile-disclosure p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

/* --- Expense Estimates Section --- */
.expense-estimates {
    margin-top: 40px;
    background-color: #fafafa;
    border: 1px solid #eee;
    padding: 30px;
}

.expense-estimates h3 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 20px;
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
}

.expense-list {
    display: flex;
    flex-direction: column;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.expense-item.total {
    margin-top: 10px;
    border-top: 2px solid #111;
    border-bottom: none;
    padding-top: 15px;
}

.expense-item.total .expense-label,
.expense-item.total .expense-value {
    font-weight: 700;
    color: #111;
    font-size: 1.1rem;
}

.expense-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
}

.expense-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
}

.expense-note {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #777;
    font-style: italic;
    line-height: 1.4;
}

/* --- Gatekeeper Access Overlay --- */
.gatekeeper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999; /* Forces it to the very front */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.gatekeeper-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.gatekeeper-content h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #111;
}

.gatekeeper-content p {
    color: #777;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.password-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.password-box input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    outline: none;
    letter-spacing: 2px;
}

.password-box input:focus {
    border-color: #111;
}

.password-box button {
    width: 100%;
    background-color: #111;
    color: white;
    border: 2px solid #111;
    padding: 15px;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-box button:hover {
    background-color: transparent;
    color: #111;
}

.error-text {
    color: #d32f2f !important;
    margin-top: 15px !important;
    font-size: 0.8rem !important;
    display: none;
}

/* --- Mobile Layout Fixes --- */
@media (max-width: 850px) {
    
	html {
		scroll-padding-top: 180px;
	}
	
    /* 1. Fix the Header & Navbar */
    header {
        flex-direction: column; 
        padding: 10px 15px;
        gap: 8px;
    }

    nav {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 10px;
    }

    .auth-status {
        margin-left: 0;
        padding-left: 0;
        border-left: none; 
        border-top: 1px solid #eee; 
        padding-top: 10px;
        width: 100%;
        justify-content: center;
    }

	.hero-content {
        padding-top: 180px;
    }

    .profile-wrapper, .account-wrapper {
        padding-top: 180px;
        padding-left: 15px; /* Expands the content to match the index cards */
        padding-right: 15px;
        padding-bottom: 40px; /* Tightens up the bottom spacing a bit on mobile too */
    }
	
	.filters-container {
		flex-direction: column;
		gap: 30px;
	}
	
	.filters-container.open {
		max-height: 1500px;
		padding: 30px;
	}
	
    /* 2. Center the Horse Cards (Without resizing them) */
    .listings {
        justify-content: center; /* Ensures the cards stay perfectly in the middle */
        padding: 40px 10px; /* Shrinks the side padding so it stops pushing the cards right */
    }
}