/* General Styles */
body {
    min-height: 100vh;
    display: block;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    box-sizing: border-box;
}

html {
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll at root */
}

*, *::before, *::after {
    box-sizing: inherit;
}

main {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem; /* Match Bootstrap gutter to avoid overflow */
}

.custom-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
}

.form-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

/* NEW: Navbar container width */
.navbar .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
}

/* NEW: Default shop images */
.default-shop-cover {
    background: linear-gradient(45deg, #3f51b5, #5c6bc0);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.default-profile-pic {
    background: #5c6bc0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* Cards */
.card {
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Vehicle Ad Cards */
.vehicle-card img {
    height: 200px;
    object-fit: cover;
}

.vehicle-card .card-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.vehicle-card .price {
    color: #28a745;
    font-size: 1rem;
    font-weight: bold;
}

/* Footer */
footer {
    margin-top: 0 !important;
    padding: 2px 0 !important;
    min-height: auto !important;
    height: auto !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

footer .row {
    margin: 0 !important;
}

footer p {
    margin: 0 !important;
    line-height: 1.2 !important;
}

footer a {
    line-height: 1.2 !important;
}

/* Responsive Images */
.img-responsive {
    max-width: 100%;
    height: auto;
}

/* Search Form */
.search-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

/* Filter dropdown styles - reduced font size */
.search-filter .form-select,
.search-filter .form-control {
    font-size: 0.875rem !important;
}

/* Filter Sidebar */
.filter-sidebar {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
}

/* User Profile */
.profile-header {
    background-color: #f8f9fa;
    padding: 30px 0;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

/* Ad Details */
.ad-gallery img {
    max-height: 400px;
    object-fit: contain;
}

.ad-details {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
}

/* Pagination */
.pagination {
    margin-top: 30px;
}

/* Global Pagination Size Reduction - More Specific */
.pagination .page-link,
.pagination a.page-link,
.pagination .page-item .page-link {
    padding: 0.2rem 0.4rem !important;
    margin: 0 0.05rem !important;
    font-size: 0.7rem !important;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Desktop pagination - slightly larger */
@media (min-width: 1025px) {
    .pagination .page-link,
    .pagination a.page-link,
    .pagination .page-item .page-link,
    .pagination .page-item a.page-link,
    .pagination .page-item:not(.disabled) .page-link {
        padding: 0.2rem 0.4rem !important;
        margin: 0 0.05rem !important;
        font-size: 0.7rem !important;
        min-width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .pagination-container {
        margin-top: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* Tablet pagination */
@media (min-width: 769px) and (max-width: 1024px) {
    .pagination .page-link {
        padding: 0.2rem 0.4rem !important;
        margin: 0 0.05rem !important;
        font-size: 0.7rem !important;
    }
}

/* Mobile pagination */
@media (max-width: 768px) {
    .pagination .page-link {
        padding: 0.15rem 0.3rem !important;
        margin: 0 0.03rem !important;
        font-size: 0.65rem !important;
        min-width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Force pagination size override - Maximum specificity */
.pagination .page-link,
.pagination a.page-link,
.pagination .page-item .page-link,
.pagination .page-item a.page-link,
.pagination .page-item:not(.disabled) .page-link,
.pagination .page-item:not(.disabled) a.page-link {
    padding: 0.2rem 0.4rem !important;
    margin: 0 0.05rem !important;
    font-size: 0.7rem !important;
    min-width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Seller Link Styles */
.seller-link {
    transition: all 0.2s ease;
    position: relative;
}

.seller-link:hover {
    color: #2855a7 !important;
    text-decoration: none !important;
}

.seller-link:hover i {
    opacity: 1 !important;
    transform: translateX(2px);
}

.seller-link i {
    transition: all 0.2s ease;
}


/* Responsive Design */
@media (min-width: 1025px) {
    .container,
    .custom-container,
    .form-container,
    .navbar .container {
        width: 60vw;
    }

    /* Desktop Typography Adjustments - Fixed pixel sizes for consistent display across resolutions */
    
    /* Base font size reduction for desktop - using pixels for consistency */
    body {
        font-size: 14px !important;
        line-height: 1.4;
    }

    /* Headings - using pixels to prevent scaling on high-res displays */
    h1 {
        font-size: 28px !important;
        line-height: 1.3;
    }

    h2 {
        font-size: 24px !important;
        line-height: 1.3;
    }

    h3 {
        font-size: 20px !important;
        line-height: 1.3;
    }

    h4 {
        font-size: 18px !important;
        line-height: 1.3;
    }

    h5 {
        font-size: 16px !important;
        line-height: 1.3;
    }

    h6 {
        font-size: 14px !important;
        line-height: 1.3;
    }

    /* Paragraphs and text */
    p {
        font-size: 14px !important;
        line-height: 1.4;
    }

    /* Navigation and buttons */
    .navbar-brand {
        font-size: 18px !important;
    }

    .nav-link {
        font-size: 14px !important;
    }

    .btn {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }

    .btn-lg {
        font-size: 16px !important;
        padding: 10px 20px !important;
    }

    .btn-sm {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    /* Form elements */
    .form-control {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    .form-label {
        font-size: 14px !important;
        font-weight: 500;
    }

    .form-text {
        font-size: 12px !important;
    }

    /* Cards and content */
    .card-title {
        font-size: 16px !important;
    }

    .card-text {
        font-size: 14px !important;
    }

    .card-subtitle {
        font-size: 12px !important;
    }

    /* Alerts and notifications */
    .alert {
        font-size: 14px !important;
        padding: 12px !important;
    }

    .alert-heading {
        font-size: 16px !important;
    }

    /* Tables */
    .table {
        font-size: 14px !important;
    }

    .table th {
        font-size: 14px !important;
    }

    .table td {
        font-size: 14px !important;
    }

    /* Badges */
    .badge {
        font-size: 12px !important;
    }

    /* Modal */
    .modal-title {
        font-size: 18px !important;
    }

    .modal-body {
        font-size: 14px !important;
    }

    /* Dropdown */
    .dropdown-item {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }

    /* Pagination */
    .page-link {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    .page-item .page-link {
        font-size: 14px !important;
    }

    /* List groups */
    .list-group-item {
        font-size: 14px !important;
        padding: 12px !important;
    }

    /* Custom components */
    .vehicle-card .card-title {
        font-size: 16px !important;
    }

    .vehicle-card .price {
        font-size: 14px !important;
    }

    .search-form label {
        font-size: 14px !important;
    }

    .search-form .form-control {
        font-size: 14px !important;
    }

    /* Footer */
    footer {
        font-size: 12px !important;
        padding: 1px 0 !important;
        min-height: auto !important;
        height: auto !important;
    }

    footer h5 {
        font-size: 14px !important;
    }

    footer .row {
        margin: 0 !important;
    }

    footer p {
        margin: 0 !important;
        line-height: 1.1 !important;
    }

    footer a {
        line-height: 1.1 !important;
    }

    /* Utility classes */
    .text-small {
        font-size: 12px !important;
    }

    .text-large {
        font-size: 16px !important;
    }

    /* Custom notification adjustments */
    .custom-notification {
        font-size: 14px !important;
        padding: 12px 16px !important;
    }

    /* Profile and user-related */
    .profile-header h1 {
        font-size: 24px !important;
    }

    .profile-header p {
        font-size: 14px !important;
    }

    /* Ad details */
    .ad-details h3 {
        font-size: 18px !important;
    }

    .ad-details p {
        font-size: 14px !important;
    }

    /* Specs and details */
    .specs-bar {
        font-size: 12px !important;
    }

    .specs-bar .spec-item {
        font-size: 12px !important;
    }

    /* Contact info */
    .contact-info {
        font-size: 14px !important;
    }

    .contact-info strong {
        font-size: 14px !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container,
    .custom-container,
    .form-container,
    .navbar .container {
        width: calc(100% - 40px);
        margin-left: 20px;
        margin-right: 20px;
        padding: 0;
    }
    
    /* Filter dropdown styles for tablet - reduced font size */
    .search-filter .form-select,
    .search-filter .form-control {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 768px) {
    .container,
    .custom-container,
    .form-container,
    .navbar .container {
        width: 100%;
        max-width: 100%;
        padding: 0 0.75rem; /* Keep consistent padding */
    }

    .vehicle-card img {
        height: 150px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    /* Mobile Typography Adjustments - Best Practices */
    
    /* Base font size reduction for mobile */
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Headings */
    h1 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }

    h4 {
        font-size: 1rem !important;
        line-height: 1.3;
    }

    h5 {
        font-size: 0.9rem !important;
        line-height: 1.3;
    }

    h6 {
        font-size: 0.85rem !important;
        line-height: 1.3;
    }

    /* Paragraphs and text */
    p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Navigation and buttons */
    .navbar-brand {
        font-size: 1.1rem !important;
    }

    .nav-link {
        font-size: 0.9rem !important;
    }

    .btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }

    .btn-lg {
        font-size: 0.9rem !important;
        padding: 0.6rem 1.2rem !important;
    }

    .btn-sm {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }

    /* Form elements */
    .form-control {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    .form-label {
        font-size: 0.85rem !important;
        font-weight: 500;
    }

    .form-text {
        font-size: 0.8rem !important;
    }

    /* Cards and content */
    .card-title {
        font-size: 1rem !important;
    }

    .card-text {
        font-size: 0.85rem !important;
    }

    .card-subtitle {
        font-size: 0.8rem !important;
    }

    /* Alerts and notifications */
    .alert {
        font-size: 0.85rem !important;
        padding: 0.75rem !important;
    }

    .alert-heading {
        font-size: 1rem !important;
    }

    /* Tables */
    .table {
        font-size: 0.85rem !important;
    }

    .table th {
        font-size: 0.85rem !important;
    }

    .table td {
        font-size: 0.85rem !important;
    }

    /* Badges */
    .badge {
        font-size: 0.75rem !important;
    }

    /* Modal */
    .modal-title {
        font-size: 1.1rem !important;
    }

    .modal-body {
        font-size: 0.9rem !important;
    }

    /* Dropdown */
    .dropdown-item {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }

    /* Pagination */
    .page-link {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    .page-item .page-link {
        font-size: 0.85rem !important;
    }

    /* List groups */
    .list-group-item {
        font-size: 0.85rem !important;
        padding: 0.75rem !important;
    }

    /* Custom components */
    .vehicle-card .card-title {
        font-size: 0.95rem !important;
    }

    .vehicle-card .price {
        font-size: 0.9rem !important;
    }

    .search-form label {
        font-size: 0.85rem !important;
    }

    .search-form .form-control {
        font-size: 0.85rem !important;
    }
    
    /* Filter dropdown styles for mobile - reduced font size */
    .search-filter .form-select,
    .search-filter .form-control {
        font-size: 0.75rem !important;
    }

    /* Footer */
    footer {
        font-size: 0.8rem !important;
        padding: 1px 0 !important;
        min-height: auto !important;
        height: auto !important;
    }

    footer h5 {
        font-size: 0.9rem !important;
    }

    footer .row {
        margin: 0 !important;
    }

    footer p {
        margin: 0 !important;
        line-height: 1.1 !important;
    }

    footer a {
        line-height: 1.1 !important;
    }

    /* Utility classes */
    .text-small {
        font-size: 0.8rem !important;
    }

    .text-large {
        font-size: 1rem !important;
    }

    /* Custom notification adjustments */
    .custom-notification {
        font-size: 0.85rem !important;
        padding: 0.75rem 1rem !important;
    }

    /* Profile and user-related */
    .profile-header h1 {
        font-size: 1.3rem !important;
    }

    .profile-header p {
        font-size: 0.85rem !important;
    }

    /* Ad details */
    .ad-details h3 {
        font-size: 1.1rem !important;
    }

    .ad-details p {
        font-size: 0.85rem !important;
    }

    /* Specs and details */
    .specs-bar {
        font-size: 0.8rem !important;
    }

    .specs-bar .spec-item {
        font-size: 0.8rem !important;
    }

    /* Contact info */
    .contact-info {
        font-size: 0.85rem !important;
    }

    .contact-info strong {
        font-size: 0.85rem !important;
    }
}

/* No fixed freeze; container will keep min-width 950px until tablet breakpoint */

/* Custom: Match Post/Edit Ad buttons to paragraph font size and weight */
.btn-submit,
.btn-outline-secondary.btn-lg {
    font-size: 1rem !important;
    font-weight: 500 !important;
    padding: 0.75rem 2rem !important; /* reduce padding for smaller look */
}

/* Unify navbar container width and padding for all pages */
.navbar .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
}
@media (min-width: 1025px) {
    .navbar .container {
        width: 60vw;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 0.75rem;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar .container {
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        margin-left: 20px;
        margin-right: 20px;
        padding: 0;
    }
}
@media (max-width: 768px) {
    .navbar .container {
        width: 100%;
        max-width: 100%;
        padding: 0 0.75rem;
    }
}

