/* Główne style CSS dla aplikacji bidfaxusa */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header h1 {
    margin: 0;
    padding: 0 20px;
}

/* Navigation */
.nav {
    background-color: #34495e;
    padding: 10px 0;
}

.nav ul {
    list-style: none;
    display: flex;
    padding: 0 20px;
}

.nav li {
    margin-right: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: #2c3e50;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    color: #2c3e50;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-success {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-warning {
    background-color: #f39c12;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #34495e;
    color: white;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    padding: 10px;
}

.col-2 {
    flex: 0 0 50%;
    padding: 10px;
}

.col-3 {
    flex: 0 0 33.333%;
    padding: 10px;
}

.col-4 {
    flex: 0 0 25%;
    padding: 10px;
}

/* Car details – galeria interaktywna */
.car-details-gallery {
    margin-top: 0.5rem;
}
.gallery-viewer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 8px;
    min-height: 280px;
}
.gallery-main-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 260px;
}
.gallery-main-img {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.gallery-main-img:hover {
    opacity: 0.95;
}
.gallery-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.gallery-btn:hover {
    background: rgba(255,255,255,0.3);
}
.gallery-counter {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #eee;
    transition: border-color 0.2s, opacity 0.2s;
}
.gallery-thumb:hover {
    opacity: 0.9;
}
.gallery-thumb.active {
    border-color: #3498db;
    box-shadow: 0 0 0 1px #3498db;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.gallery-lightbox.lightbox-open {
    opacity: 1;
    visibility: visible;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    transition: background 0.2s;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

/* Car grid */
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.car-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.car-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.car-card-body {
    padding: 15px;
}

.car-card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.car-card-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 10px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.pagination::-webkit-scrollbar {
    height: 6px;
}

.pagination::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pagination::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.pagination::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    min-width: 40px;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: bold;
}

.pagination-arrow {
    font-weight: bold;
    font-size: 18px;
    padding: 8px 10px !important;
}

.pagination-ellipsis {
    padding: 8px 5px;
    color: #666;
    user-select: none;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Autocomplete – lista podpowiedzi (dashboard i inne) */
.autocomplete-results {
    position: absolute;
    background: #fff;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: none;
    margin-top: 6px;
}

/* Element listy – wspólny styl (autocomplete-item) */
.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item strong {
    color: #2c3e50;
    font-size: 16px;
}

.autocomplete-item small {
    color: #666;
    font-size: 14px;
}

/* Podpowiedzi wyszukiwarki (dashboard) – search-result-item */
.autocomplete-results .search-result-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.15s, border-left-color 0.15s;
    border-left: 3px solid transparent;
    font-size: 15px;
    line-height: 1.4;
}

.autocomplete-results .search-result-item:last-child {
    border-bottom: none;
}

.autocomplete-results .search-result-item:hover {
    background-color: #e8f4fc;
    border-left-color: #3498db;
}

.autocomplete-results .search-result-item strong {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.autocomplete-results .search-result-item small {
    color: #444;
    font-size: 14px;
    line-height: 1.35;
}

/* „Brak wyników” – bez danych, nieklikalne */
.autocomplete-results .search-result-item:not([data-car-id]):not([data-vin]) {
    cursor: default;
    color: #666;
}

.autocomplete-results .search-result-item:not([data-car-id]):not([data-vin]):hover {
    background-color: #fff;
    border-left-color: transparent;
}

.form-group {
    position: relative;
}

/* SEO improvements */
h1 {
    font-size: 2em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.5em;
    margin-bottom: 0.5em;
}

/* Structured data visibility */
[itemscope] {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .car-grid {
        grid-template-columns: 1fr;
    }
    
    .col-2,
    .col-3,
    .col-4 {
        flex: 0 0 100%;
    }
    
    .nav ul {
        flex-direction: column;
    }
    
    .nav li {
        margin-bottom: 10px;
    }
    
    .autocomplete-results {
        max-height: 300px;
    }
    
    .gallery-viewer {
        min-height: 220px;
    }
    .gallery-main-wrap {
        min-height: 200px;
    }
    .gallery-main-img {
        max-height: 240px;
    }
    .gallery-btn {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    .gallery-thumb {
        width: 56px;
        height: 56px;
    }
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close {
        top: 8px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* Stopka */
.footer {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 1rem 20px 2rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}
.footer a {
    color: #2c3e50;
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}
.footer-sep {
    margin: 0 0.5rem;
    color: #adb5bd;
}

.nav .lang-switcher a,
.nav .nav-sep {
    color: rgba(255,255,255,0.9);
}
.nav .lang-switcher .nav-sep {
    margin: 0 0.25rem;
}

/* Strony statyczne (regulamin, polityka) */
.static-page .card-body section {
    margin-top: 1.5rem;
}
.static-page .card-body section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}
.static-page .card-body .intro {
    margin-bottom: 1rem;
}
