/**
 * Waldoch Gallery - Public-facing Styles
 * Designed to match current Piwigo gallery appearance
 * Version: 1.1 - Updated social buttons
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f0f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 10px 20px 10px 20px;
    background: #fff;
    font-size: 14px;
    margin-bottom: 0;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs.breadcrumbs-flush {
    padding-left: 0;
}

.vehicle-grid.vehicle-grid-flush {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Page Headings */
.container > h1 {
    padding: 20px 20px 0;
}

/* Category Description */
.category-description {
    padding: 0 20px 20px 20px;
    background: #fff;
    line-height: 1.6;
}

.category-description p {
    margin: 0 0 15px;
}

.category-description p:last-child {
    margin-bottom: 0;
}

.category-description h3 {
    margin: 10px 0 20px;
}

/* Gallery/Vehicle Detail Description */
.gallery-description {
    padding: 20px;
    color: #555;
    line-height: 1.6;
}

/* Category Grid (Homepage) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px 30px 20px;
}

.category-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.category-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-card img,
.category-card .placeholder-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.category-card h2 {
    font-size: 18px;
    padding: 15px;
    text-align: center;
    background: #f8f8f8;
}

.category-card .count {
    padding: 0 15px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Vehicle Grid Container */
.vehicle-grid-container {
    padding: 30px 20px;
}

.results-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.results-header p {
    color: #666;
    font-size: 14px;
}

/* Vehicle Grid */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
    margin-bottom: 30px;
}

.vehicle-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.vehicle-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vehicle-card img,
.vehicle-card .placeholder-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.vehicle-card h3 {
    font-size: 18px;
    padding: 15px;
    text-align: center;
    background: #f8f8f8;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0 20px;
    padding: 0px 0px 40px;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-link:hover {
    background: #007bff;
    color: white;
}

.page-link.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Vehicle Detail Page */
.vehicle-detail {
    padding: 20px 20px 0 20px;
}

.related-content {
    padding: 5px 20px 30px 20px;
}

.vehicle-detail h2,
.related-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.vehicle-info {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.vehicle-info dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
}

.vehicle-info dt {
    font-weight: bold;
    color: #555;
}

.vehicle-info dd {
    color: #333;
}

/* Image Gallery */
.image-gallery {
    margin-bottom: 10px;
    text-align: center;
}

.hero-image {
    position: relative;
    margin-bottom: 20px;
    background: #000;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 40px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: background 0.3s;
}

.nav-arrow:hover {
    background: rgba(0,0,0,0.8);
}

.nav-arrow.prev {
    left: 10px;
}

.nav-arrow.next {
    right: 10px;
}

/* Thumbnail Strip */
.thumbnail-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
    max-width: 100%;
}

.thumbnail {
    flex: 0 0 120px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.thumbnail:hover {
    border-color: #007bff;
}

.thumbnail.active {
    border-color: #007bff;
}

/* Image Actions - Share and Download */
.image-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin: 20px auto;
    flex-wrap: wrap;
    max-width: fit-content;
}

.share-label {
    font-weight: 600;
    color: #555;
    font-size: 15px;
    margin-right: 5px;
}

.social-btn,
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: #292724 !important;
    color: white !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.download-btn svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

.social-btn:hover,
.download-btn:hover {
    background: #3d3a36 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 39, 36, 0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.btn:hover {
    background: #555;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Vehicle/Gallery Tags Section */
.vehicle-tags-section {
    margin-top: 0;
    padding: 10px 20px;
    background: #fff;
}

.vehicle-tags-group {
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.vehicle-tags-group strong {
    color: #333;
}

.vehicle-tags-group a {
    color: #007bff;
    text-decoration: none;
}

.vehicle-tags-group a:hover {
    text-decoration: underline;
}

/* Search Bar (in header) */
.gallery-search-bar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
}

.gallery-search-inner {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 44px 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input-wrapper input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.search-submit {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #666;
    display: flex;
    align-items: center;
}

.search-submit:hover {
    color: #007bff;
}

/* Autocomplete Dropdown */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

.suggest-category {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    background: #f8f8f8;
    border-top: 1px solid #eee;
}

.suggest-category:first-child {
    border-top: none;
}

.suggest-item {
    display: block;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.suggest-item:hover {
    background: #f0f4ff;
    color: #007bff;
}

/* Search Results Page */
.search-results-header {
    padding: 20px 20px 10px;
}

.search-results-form {
    display: flex;
    gap: 10px;
}

.search-results-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

.search-results-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.search-results-info {
    padding: 0 20px 10px;
    color: #666;
    font-size: 14px;
}

.result-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.badge-vehicle {
    background: #007bff;
    color: #fff;
}

.badge-gallery {
    background: #28a745;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }

    .vehicle-grid-container {
        padding: 20px 15px;
    }

    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }

    .nav-arrow {
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    .vehicle-info dl {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .vehicle-info dt {
        margin-top: 10px;
    }

    .image-actions {
        justify-content: center;
    }

    .share-label {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .gallery-search-inner {
        max-width: 100%;
    }

    .search-results-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .category-grid,
    .vehicle-grid {
        grid-template-columns: 1fr;
    }

    .social-btn,
    .download-btn {
        width: 40px;
        height: 40px;
    }

    .social-btn svg {
        width: 18px;
        height: 18px;
    }

    .download-btn svg {
        width: 20px;
        height: 20px;
    }

    .gallery-search-bar {
        padding: 8px 10px;
    }

    .search-suggestions {
        max-height: 250px;
    }
}
