/**
 * Frontend Styles for WS Service Partners
 */

/* Wrapper */
.ws-service-partners-wrapper {
    position: relative;
}

/* Filters */
.ws-filters {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ws-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.ws-filter-field {
    flex: 1;
    min-width: 200px;
}

.ws-filter-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.ws-filter-field select,
.ws-filter-field input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.ws-filter-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}

.ws-filter-field input[type="text"] {
    cursor: text;
}

.ws-filter-field select:focus,
.ws-filter-field input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Force show selects and hide jQuery UI selectmenu */
.ws-filter-field select {
    display: block !important;
}

.ws-filter-field .ui-selectmenu-button,
.ws-filter-field .ui-helper-hidden-accessible {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ws-filter-submit {
    padding: 10px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-filter-submit:hover {
    background: #005a87;
}

.ws-filter-submit i {
    font-size: 16px;
}

/* Partner List */
.ws-service-partners-list {
    margin-bottom: 40px;
}

.ws-state-group {
    margin-bottom: 50px;
}

.ws-state-group:last-child {
    margin-bottom: 0;
}

.ws-state-title {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* Partners Grid */
.ws-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Partner Card */
.partner-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.partner-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

/* Partner Logo */
.partner-logo {
    padding: 20px;
    text-align: center;
    background: #fff;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo img {
    max-width: 200px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Card Content Padding */
.partner-card > *:not(.partner-logo):not(.partner-company-image):not(.partner-logos-accordion) {
    padding-left: 20px;
    padding-right: 20px;
}

/* Partner Name */
.partner-name {
    margin: 20px 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Partner Address */
.partner-address {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

/* Partner Contact */
.partner-contact {
    margin-bottom: 20px;
    flex-grow: 1;
}

.partner-contact p {
    margin: 0 0 8px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.partner-contact p:last-child {
    margin-bottom: 0;
}

.partner-contact i {
    color: #0073aa;
    font-size: 16px;
    min-width: 16px;
}

.partner-contact a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.partner-contact a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Partner Company Image */
.partner-company-image {
    margin: 0;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 180px;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-company-image img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    display: block;
}

/* Partner Categories */
.partner-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.partner-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.partner-category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.partner-category-badge i {
    font-size: 13px;
}

/* Partner Logos Accordion */
.partner-logos-accordion {
    margin-top: auto;
    border-top: 1px solid #e9ecef;
}

.partner-logos-toggle {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.partner-logos-toggle:hover {
    color: #0073aa;
    background: #f8f9fa;
}

.partner-logos-toggle i {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.partner-logos-toggle.active i {
    transform: rotate(180deg);
}

.partner-logos-content {
    padding: 0 20px 20px 20px;
}

.partner-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.partner-logo-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    transition: all 0.2s ease;
}

.partner-logo-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.partner-logo-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* No Results */
.ws-no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

/* Loading Spinner */
.ws-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.ws-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 115, 170, 0.2);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ws-spin 0.8s linear infinite;
}

@keyframes ws-spin {
    to {
        transform: rotate(360deg);
    }
}

.ws-service-partners-list.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */

/* Tablet - 2 Spalten */
@media screen and (max-width: 1024px) {
    .ws-partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .ws-state-title {
        font-size: 24px;
    }
}

/* Mobile - 1 Spalte */
@media screen and (max-width: 768px) {
    .ws-filter-form {
        flex-direction: column;
    }

    .ws-filter-field {
        width: 100%;
        min-width: 100%;
    }

    .ws-filter-submit {
        width: 100%;
        justify-content: center;
    }

    .ws-partners-grid {
        grid-template-columns: 1fr;
    }

    .ws-state-title {
        font-size: 22px;
    }
}

@media screen and (max-width: 480px) {
    .ws-filters {
        padding: 20px 15px;
    }

    .ws-state-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .partner-name {
        font-size: 18px;
    }

    .partner-logo img {
        max-width: 150px;
        max-height: 80px;
    }
}
