/**
 * Styling für die erweiterte Suchseite
 * 
 * @package Woodmart Child
 * @since 1.0.0
 */

/* ==========================================================================
   Erweiterte Suchseite
   ========================================================================== */

.advanced-search-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.search-page-header .page-title {
    font-size: 3em;
    margin-bottom: 15px;
    color: #2c3e50;
}

.search-page-header .page-description {
    font-size: 1.2em;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Suchformular
   ========================================================================== */

.advanced-search-container {
    position: relative;
}

.search-form-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 40px;
}

.advanced-search-form .search-input-group {
    position: relative;
    margin-bottom: 25px;
}

.search-icon-wrapper {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    z-index: 2;
}

.search-icon-wrapper .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.advanced-search-field {
    width: 100%;
    padding: 18px 50px 18px 55px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.advanced-search-field:focus {
    outline: none;
    border-color: rgba(121, 179, 138, 1);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(121, 179, 138, 0.1);
}

.clear-search {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.clear-search:hover {
    background: #e0e0e0;
    color: #2c3e50;
}

.clear-search .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Suchoptionen
   ========================================================================== */

.search-options {
    margin-bottom: 25px;
}

.search-type-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-type-option {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.search-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.search-type-option .option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.search-type-option .option-label .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.search-type-option input[type="radio"]:checked + .option-label {
    background: rgba(121, 179, 138, 1);
    border-color: rgba(121, 179, 138, 1);
    color: #fff;
}

.search-type-option .option-label:hover {
    border-color: rgba(121, 179, 138, 1);
    background: rgba(121, 179, 138, 0.1);
}

.search-type-option input[type="radio"]:checked + .option-label:hover {
    background: rgba(101, 159, 118, 1);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.search-submit-wrapper {
    text-align: center;
}

.advanced-search-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: rgba(121, 179, 138, 1);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(121, 179, 138, 0.3);
}

.advanced-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(121, 179, 138, 0.4);
    background: rgba(101, 159, 118, 1);
}

.advanced-search-submit:active {
    transform: translateY(0);
}

.advanced-search-submit .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Live-Suchergebnisse
   ========================================================================== */

.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: -20px;
    max-height: 600px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
}

.live-results-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.close-live-results {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-live-results:hover {
    background: #e0e0e0;
    color: #2c3e50;
}

.live-results-content {
    max-height: 450px;
    overflow-y: auto;
}

.live-search-loading {
    padding: 40px;
    text-align: center;
    color: #95a5a6;
}

.live-search-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.live-search-error,
.no-live-results {
    padding: 40px;
    text-align: center;
    color: #95a5a6;
}

.no-live-results .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.no-live-results .suggestion {
    font-size: 14px;
    margin-top: 10px;
}

.live-results-list {
    padding: 10px;
}

.results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.live-results-group {
    margin-bottom: 20px;
}

.live-results-group:last-child {
    margin-bottom: 0;
}

.group-title {
    padding: 10px 15px;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-result-item {
    margin-bottom: 8px;
}

.live-result-link {
    display: flex;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.live-result-link:hover {
    background: #f8f9fa;
}

.live-result-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.live-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-result-content {
    flex: 1;
    min-width: 0;
}

.live-result-type {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(121, 179, 138, 1);
    border-radius: 3px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.live-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-result-title a {
    color: inherit;
    text-decoration: none;
}

.live-result-title a:hover {
    color: rgba(121, 179, 138, 1);
}

.live-result-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.live-result-excerpt {
    font-size: 13px;
    color: #95a5a6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.live-result-excerpt mark,
.live-result-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 3px;
    border-radius: 2px;
}

.live-results-more {
    padding: 15px 25px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
    font-size: 14px;
    color: #7f8c8d;
}

.live-results-footer {
    padding: 15px 25px;
    text-align: center;
    border-top: 2px solid #f0f0f0;
    background: #f8f9fa;
    font-size: 13px;
    color: #95a5a6;
}

/* ==========================================================================
   Beliebte Suchbegriffe
   ========================================================================== */

.search-suggestions-wrapper {
    margin: 40px 0;
    text-align: center;
}

.search-suggestions-wrapper h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.popular-search-tag {
    display: inline-block;
    padding: 10px 20px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.popular-search-tag:hover {
    background: rgba(121, 179, 138, 1);
    color: #fff;
    transform: translateY(-2px);
}

/* ==========================================================================
   Firmengeschichten Preview
   ========================================================================== */

.recent-firmengeschichten-wrapper {
    margin: 60px 0;
}

.recent-firmengeschichten-wrapper h3 {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

.firmengeschichten-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.firmengeschichte-preview-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.firmengeschichte-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.preview-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.firmengeschichte-preview-card:hover .preview-thumbnail img {
    transform: scale(1.05);
}

.preview-content {
    padding: 20px;
}

.preview-title {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.preview-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.preview-title a:hover {
    color: rgba(121, 179, 138, 1);
}

.preview-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
}

.view-all-link {
    text-align: center;
}

.view-all-link .button {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(121, 179, 138, 1);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-all-link .button:hover {
    background: rgba(101, 159, 118, 1);
    transform: translateY(-2px);
}

/* ==========================================================================
   Suchergebnisse Seite
   ========================================================================== */

.search-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-results-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.search-results-info {
    text-align: center;
    margin-bottom: 30px;
}

.search-results-info .page-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.search-results-info .search-term {
    color: rgba(121, 179, 138, 1);
}

.results-count {
    font-size: 1.1em;
    color: #7f8c8d;
}

/* Inline-Suchformular */
.search-again-form {
    max-width: 600px;
    margin: 0 auto;
}

.inline-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.inline-search-form .search-field {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
}

.inline-search-form .search-submit {
    padding: 12px 25px;
    background: rgba(121, 179, 138, 1);
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inline-search-form .search-submit:hover {
    background: rgba(101, 159, 118, 1);
}

.search-type-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.search-type-btn {
    padding: 8px 20px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-type-btn:hover {
    background: #d5dbdb;
}

.search-type-btn.active {
    background: rgba(121, 179, 138, 1);
    color: #fff;
}

/* Suchergebnis-Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.search-result-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.result-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-card:hover .result-thumbnail img {
    transform: scale(1.05);
}

.result-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
}

.post-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(121, 179, 138, 1);
    color: #fff;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.post-type-badge.firmengeschichte {
    background: rgba(121, 179, 138, 1);
}

.post-type-badge.product {
    background: rgba(101, 159, 118, 1);
}

.post-date {
    color: #95a5a6;
}

.result-title {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.result-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: rgba(121, 179, 138, 1);
}

.result-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
}

.result-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.result-excerpt {
    font-size: 15px;
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.result-excerpt mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(121, 179, 138, 1);
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
    transition: all 0.2s ease;
}

.read-more-link:hover {
    gap: 8px;
}

.read-more-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Keine Ergebnisse */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 80px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.no-results-icon .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
}

.no-results h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.search-suggestions {
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
}

.search-suggestions h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.search-suggestions ul {
    list-style: none;
    padding: 0;
}

.search-suggestions li {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.search-suggestions li:before {
    content: "→ ";
    color: rgba(121, 179, 138, 1);
    font-weight: 600;
    margin-right: 8px;
}

.try-another-search {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.try-another-search .button {
    padding: 12px 30px;
    background: rgba(121, 179, 138, 1);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.try-another-search .button:hover {
    background: rgba(101, 159, 118, 1);
    transform: translateY(-2px);
}

.try-another-search .button-secondary {
    background: #95a5a6;
}

.try-another-search .button-secondary:hover {
    background: #7f8c8d;
}

/* Pagination */
.search-pagination {
    margin: 40px 0;
}

.search-pagination .page-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-pagination .page-numbers li {
    margin: 0;
}

.search-pagination .page-numbers a,
.search-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: #fff;
    color: #2c3e50;
    text-decoration: none;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-pagination .page-numbers a:hover {
    background: rgba(121, 179, 138, 1);
    color: #fff;
    border-color: rgba(121, 179, 138, 1);
}

.search-pagination .page-numbers .current {
    background: rgba(121, 179, 138, 1);
    color: #fff;
    border-color: rgba(121, 179, 138, 1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .search-page-header .page-title {
        font-size: 2em;
    }

    .search-form-wrapper {
        padding: 25px;
    }

    .advanced-search-field {
        font-size: 16px;
        padding: 15px 45px 15px 50px;
    }

    .search-type-selector {
        flex-direction: column;
    }

    .search-type-option {
        max-width: 100%;
    }

    .firmengeschichten-preview-grid,
    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .live-search-results {
        margin-top: 0;
        border-radius: 0 0 12px 12px;
    }

    .try-another-search {
        flex-direction: column;
    }

    .search-pagination .page-numbers {
        gap: 5px;
    }

    .search-pagination .page-numbers a,
    .search-pagination .page-numbers span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .advanced-search-page,
    .search-results-page {
        padding: 20px 15px;
    }

    .search-results-info .page-title {
        font-size: 1.8em;
    }

    .search-type-toggle {
        flex-direction: column;
    }
}
