/* ========================================
   HMF-IT - Referenzen CSS - Modern Redesign
   WCAG 2.1 AA konform | Mobile First
   ======================================== */

/* ========================================
   FILTER SECTION
   ======================================== */
.filter-section {
    padding: 0 0 3rem;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-dark);
    border-radius: 100px;
}

[data-bs-theme="light"] .filter-container {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 100px;
    background: transparent;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    opacity: 0.7;
}

.filter-btn:hover,
.filter-btn:focus {
    opacity: 1;
    color: var(--hmf-green-light);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: #fff;
    opacity: 1;
    box-shadow: 0 4px 20px rgba(106, 122, 38, 0.4);
}

.filter-btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.filter-info {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-info #projectCount {
    font-family: var(--font-mono);
    color: var(--hmf-green-light);
    font-size: 1rem;
}

/* ========================================
   PROJECTS SECTION
   ======================================== */
.projects-section {
    padding: 0 0 var(--section-padding);
}

/* ========================================
   MODERN GRID - Bento Layout
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ========================================
   PROJECT CARD - Modern Design
   ======================================== */
.project-card {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

[data-bs-theme="light"] .project-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.project-card:hover,
.project-card:focus-within {
    border-color: var(--hmf-green);
    box-shadow: 0 24px 64px rgba(106, 122, 38, 0.2);
}

@media (prefers-reduced-motion: no-preference) {
    .project-card:hover,
    .project-card:focus-within {
        transform: translateY(-12px);
    }
}

/* ========================================
   PROJECT IMAGE - Clean Aspect Ratios
   ======================================== */
.project-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--hmf-green) 0%, var(--hmf-gray) 100%);
    aspect-ratio: 4/3;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallback für fehlende Bilder */
.project-image img[src=""],
.project-image img:not([src]),
.project-image img.broken {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .project-card:hover .project-image img {
        transform: scale(1.06);
    }
}

/* Project Overlay */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 40%,
        rgba(15, 15, 20, 0.95) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay {
    opacity: 1;
}

.project-link {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(106, 122, 38, 0.4);
}

.project-link svg {
    width: 24px;
    height: 24px;
}

.project-card:hover .project-link,
.project-link:focus {
    transform: translateY(0) scale(1);
}

.project-link:hover {
    transform: translateY(0) scale(1.1);
}

.project-link:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

/* ========================================
   PROJECT CONTENT
   ======================================== */
.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    display: inline-block;
    width: fit-content;
    padding: 0.375rem 0.875rem;
    background: rgba(106, 122, 38, 0.12);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hmf-green-light);
    margin-bottom: 0.875rem;
}

[data-bs-theme="light"] .project-category {
    background: rgba(106, 122, 38, 0.08);
    color: var(--hmf-green);
}

.project-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.project-description {
    font-size: 0.875rem;
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tag {
    padding: 0.375rem 0.75rem;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
    transition: all var(--transition-fast);
}

[data-bs-theme="light"] .project-tag {
    background: var(--bg-light-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}

.project-card:hover .project-tag {
    border-color: var(--hmf-green);
    opacity: 1;
}

/* Hidden Projects (Filter) */
.project-card.hidden {
    display: none !important;
}

/* Fade Animation */
.project-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.project-card.fade-in {
    animation: fadeInCard 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    opacity: 0.6;
}

.no-results svg {
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.no-results p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* ========================================
   PAGINATION / LOAD MORE
   ======================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.pagination-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--glass-border-dark);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover,
.pagination-btn:focus {
    border-color: var(--hmf-green);
    color: var(--hmf-green-light);
}

.pagination-btn.active {
    background: var(--gradient-primary);
    border-color: var(--hmf-green);
    color: #fff;
}

.pagination-arrow {
    width: 48px;
    height: 48px;
}

.pagination-arrow svg {
    width: 20px;
    height: 20px;
}

.pagination-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
    padding: var(--section-padding) 0;
    background: var(--glass-bg-dark);
    border-top: 1px solid var(--glass-border-dark);
}

[data-bs-theme="light"] .cta-section {
    background: var(--bg-light-secondary);
    border-color: var(--glass-border-light);
}

.cta-section .cta-container {
    background: linear-gradient(135deg, #6a7a26 0%, #7d8f2d 100%);
    border-radius: 32px;
    padding: 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(106, 122, 38, 0.3);
}

.cta-section .cta-container::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -50%;
    width: 200%;
    height: 300%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .cta-section .cta-container::before {
        animation: ctaGlow 15s linear infinite;
    }
}

@keyframes ctaGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cta-section .cta-content {
    position: relative;
    z-index: 1;
}

.cta-section .cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.cta-section .cta-text {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .btn-cta {
    background: #fff;
    color: #566320;
    padding: 1.25rem 2.5rem;
    font-weight: 700;
    border-radius: 100px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

.cta-section .btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.cta-section .btn-cta svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1199.98px) {
    .projects-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .filter-container {
        border-radius: 24px;
        padding: 1.25rem;
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        justify-content: center;
        width: 100%;
    }

    .filter-info {
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-container {
        padding: 3rem;
        border-radius: 24px;
    }
}

@media (max-width: 767.98px) {
    .filter-container {
        padding: 1rem;
    }

    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-card {
        border-radius: 20px;
    }

    .project-image {
        aspect-ratio: 16/10;
    }

    .project-content {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1rem;
    }

    .cta-container {
        padding: 2rem;
    }

    .cta-section .btn-cta {
        padding: 1rem 2rem;
        width: 100%;
        justify-content: center;
    }

    .cta-section .d-flex {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .filter-group {
        gap: 0.375rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .project-content {
        padding: 1rem;
    }

    .project-category {
        font-size: 0.6rem;
    }

    .project-title {
        font-size: 0.95rem;
    }

    .project-description {
        font-size: 0.8rem;
    }

    .project-tag {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .project-card.fade-in {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .project-card:hover .project-image img {
        transform: none;
    }

    .project-card:hover,
    .project-card:focus-within {
        transform: none;
    }

    .project-link {
        transform: translateY(0) scale(1);
    }

    .cta-container::before {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .project-card,
    .filter-btn,
    .filter-container {
        border-width: 2px;
    }

    .project-category {
        border: 1px solid var(--hmf-green);
    }

    .project-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* Print Styles */
@media print {
    .filter-section,
    .cta-section,
    .pagination-container {
        display: none !important;
    }

    .projects-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .project-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .project-overlay {
        display: none;
    }

    .project-image {
        aspect-ratio: 16/9;
    }
}

/* ========================================
   LIGHTBOX MODAL (Optional Enhancement)
   ======================================== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-content {
    max-width: 900px;
    width: 100%;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 24px;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.project-modal.active .project-modal-content {
    transform: scale(1) translateY(0);
}

.project-modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-modal-close:hover {
    background: var(--hmf-red);
    border-color: var(--hmf-red);
}

.project-modal-close svg {
    width: 24px;
    height: 24px;
}
