/* ========================================
   PX Leistungsmanager - Grid Styles
   ======================================== */

:root {
    /* Primär- und Akzentfarben (werden via Settings überschrieben) */
    --px-primary: #1a365d;
    --px-accent: #9F3882;
    --px-accent-light: #b84996;

    /* Textfarben */
    --px-text-dark: #2d3748;
    --px-text-light: #4a5568;

    /* Allgemein */
    --px-white: #ffffff;
    --px-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --px-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --px-accent-rgb: 159, 56, 130;
}

/* ========================================
   Grid Container
   ======================================== */

.px-leistungen-grid-wrapper {
    width: 100%;
    padding: 20px 0;
}

.px-leistungen-grid {
    display: grid;
    gap: 30px;
    margin: 0;
}

/* Spalten-Varianten */
.px-leistungen-grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.px-leistungen-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.px-leistungen-grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ========================================
   Leistung Card - Basis Styles
   ======================================== */

.px-leistung-card {
    background: var(--px-white);
    border-radius: 15px;
    padding: 35px;
    transition: all 0.3s ease;
    box-shadow: var(--px-shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.px-leistung-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--px-accent), var(--px-accent-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.px-leistung-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--px-shadow);
}

.px-leistung-card:hover::before {
    transform: scaleX(1);
}

/* ========================================
   Badge
   ======================================== */

.px-leistung-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--px-accent);
    color: var(--px-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* ========================================
   Icon
   ======================================== */

.px-leistung-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--px-accent), var(--px-accent-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.px-leistung-icon .icon-emoji {
    font-size: 2rem;
    line-height: 1;
}

.px-leistung-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* ========================================
   Content
   ======================================== */

.px-leistung-title {
    font-size: 1.5rem;
    color: #0a6fb7;
    margin: 0 0 15px 0;
    font-weight: 700;
    line-height: 1.3;
}

.px-leistung-description {
    color: var(--px-text-light);
    line-height: 1.7;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.px-leistung-link {
    color: var(--px-accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.px-leistung-link .arrow {
    transition: transform 0.3s ease;
}

.px-leistung-link:hover {
    color: var(--px-accent-light);
}

.px-leistung-link:hover .arrow {
    transform: translateX(5px);
}

/* ========================================
   Grid-Überschrift
   ======================================== */

.px-leistungen-titel {
    color: var(--px-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    line-height: 1.3;
}

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

@media (max-width: 1024px) {
    .px-leistungen-grid.cols-3,
    .px-leistungen-grid.cols-4 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .px-leistungen-grid.cols-2,
    .px-leistungen-grid.cols-3,
    .px-leistungen-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .px-leistung-card {
        padding: 25px;
    }

    .px-leistung-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .px-leistung-card {
        padding: 20px;
    }

    .px-leistung-icon {
        width: 60px;
        height: 60px;
    }

    .px-leistung-icon .icon-emoji {
        font-size: 1.8rem;
    }

    .px-leistung-badge {
        top: 15px;
        right: 15px;
        font-size: 0.7rem;
        padding: 5px 12px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .px-leistung-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .px-leistung-link .arrow {
        display: none;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.px-leistung-link:focus-visible {
    outline: 3px solid var(--px-accent);
    outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .px-leistung-card {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .px-leistung-card,
    .px-leistung-link,
    .px-leistung-link .arrow,
    .px-leistung-card::before {
        transition: none;
    }

    .px-leistung-card:hover {
        transform: none;
    }

    .px-leistung-link:hover .arrow {
        transform: none;
    }
}

/* ========================================
   Kategorie-Navigation auf Einzelseiten
   ======================================== */

.px-leistung-category-nav {
    margin-top: 50px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border-left: 4px solid var(--px-accent);
}

.px-leistung-nav-title {
    font-size: 1.1rem;
    color: var(--px-primary);
    margin: 0 0 20px 0;
    font-weight: 600;
}

.px-leistung-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.px-leistung-nav-item {
    margin: 0;
}

.px-leistung-nav-item a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--px-white);
    color: var(--px-text-dark);
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.px-leistung-nav-item a:hover {
    background: var(--px-accent);
    color: var(--px-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--px-accent-rgb), 0.3);
}

.px-leistung-nav-item a:focus-visible {
    outline: 3px solid var(--px-accent);
    outline-offset: 2px;
    border-color: var(--px-accent);
}

.px-leistung-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Mehrere Kategorien */
.px-leistung-category-nav + .px-leistung-category-nav {
    margin-top: 20px;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .px-leistung-category-nav {
        padding: 20px;
        margin-top: 40px;
    }

    .px-leistung-nav-list {
        gap: 10px;
    }

    .px-leistung-nav-item a {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .px-leistung-nav-list {
        flex-direction: column;
    }

    .px-leistung-nav-item a {
        width: 100%;
        justify-content: center;
    }
}

/* Reduced Motion Navigation */
@media (prefers-reduced-motion: reduce) {
    .px-leistung-nav-item a {
        transition: none;
    }

    .px-leistung-nav-item a:hover {
        transform: none;
    }
}
