main > .container {
    padding: 70px 15px 20px;
}

a {
    color: #010101;
    text-decoration: none;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}

.progress-custom {
    height: 18px;
}

/* Redesign Styles */
body {
    /* The dark theme is now handled by Bootstrap's data-bs-theme attribute */
}

.number-plate {
    display: inline-flex;
    align-items: center;
    border: 2px solid #6c757d; /* Lighter border for dark mode */
    border-radius: 8px;
    padding: 0; /* Padding moved to children */
    font-family: "Lucida Console", "Courier New", monospace;
    font-weight: bold;
    font-size: 2rem;
    letter-spacing: 3px; /* Adjusted letter spacing */
    background-color: #fff; /* Plate should remain white */
    color: #000; /* Text on plate should remain black */
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Add padding to the number part */
.number-plate > span:first-child {
    padding: 8px 0 8px 12px; /* Reduced padding */
    display: flex; /* Use flex to align letters and digits */
    align-items: baseline; /* Align by baseline */
}

.number-letters {
    font-size: 1.8rem;
}

.number-digits {
    font-size: 2rem;
}

.number-plate .region {
    border-left: 2px solid #333;
    margin-left: 8px; /* Reduced margin */
    padding: 4px 12px 4px 8px; /* Reduced padding */
    align-self: stretch;
    display: flex;
    flex-direction: column; /* Stack vertically */
    justify-content: center; /* Center vertically */
    align-items: center; /* Center horizontally */
}

.region-code {
    font-size: 1.7rem; /* Increased font size */
    font-weight: bold;
    line-height: 1;
}

.region-label {
    font-size: 0.8rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    margin-top: 2px; /* Small space */
}

.region-flag {
    width: 22px;
    height: auto;
    margin-left: 4px;
    border: 1px solid #ccc; /* Small border around flag */
}

/* --- Feed Card Styles --- */

/* Common wrapper link styles for both card types */
.number-card-link,
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Common base styles for both card types */
.number-card-link .card,
.ad-card {
    min-height: 320px;
    min-width: 268px; /* Prevent cards from becoming too narrow */
    border: 1px solid var(--bs-border-color);
    transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
}

/* Common flexbox layout for card bodies */
.number-card-link .card .card-body,
.ad-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Hover effect ONLY for number cards */
.number-card-link:hover .card {
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border-color: var(--bs-primary);
}

/* Hover effect for clickable advertisement cards */
.card-link:hover .ad-card {
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border-color: var(--bs-primary);
}

/* Special positioning for the "Реклама" text in ad cards */
.ad-card .card-body .text-muted.text-end {
    margin-top: auto; /* Pushes it to the bottom */
    align-self: flex-end; /* Pushes it to the right */
}


/* Custom styles for search form hints/errors */
#search-form .form-floating {
    overflow: visible; /* Allow tooltips to show outside the container */
}

#search-form .form-floating .input-mask-hint, /* Now targeting input-mask-hint */
#search-form .form-floating .invalid-feedback {
    position: absolute;
    top: 100%; /* Position below the parent */
    left: 0;
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px; /* Small space from the input field */
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem; /* Bootstrap 5's default border-radius */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 100; /* Ensure it's above other elements */
    font-size: 0.875rem;
    display: none; /* Hide by default */
}

/* Show hint when input is focused */
#search-form .form-floating .form-control:focus + label + .input-mask-hint { /* Targeting input-mask-hint */
    display: block;
}

/* Show error when field is invalid */
#search-form .form-floating .is-invalid ~ .invalid-feedback {
    display: block;
}

/* Style for hints */
#search-form .form-floating .input-mask-hint { /* Targeting input-mask-hint */
    color: var(--bs-secondary-color);
}

/* Style for error messages */
#search-form .form-floating .invalid-feedback {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}

#search-results-count {
    min-height: 1.5rem; /* Ensure consistent height to prevent layout shifts */
}