.patterns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.pattern {
    aspect-ratio: 1;
    min-height: 150px;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pattern:hover {
    transform: translateY(-4px) scale(0.5);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
.pattern:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}
.pattern-item[open] .css-code {
    display: block;
}
.pattern-item:not([open]) .css-code {
    display: none;
}
.css-code {
    height: 100%;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    background: #222;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    z-index: 1;
}

.copy-button:hover {
    background: #444;
}

.css-code pre {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}


.css-code {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.pattern-item {
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: transform 0.3s ease;
}

.pattern-item > summary {
    list-style: none;
}

.pattern-item > summary::-webkit-details-marker {
    display: none;
}

.pattern-display {
    width: 100%;
    aspect-ratio: 1;
    cursor: pointer;
    display: block;
    position: relative;
    transition: transform 0.3s ease;
}

.pattern-display:hover {
    transform: scale(1.4);
}

.pattern-details {
    padding: 1rem;
    background: white;
    position: relative;
    border-top: 1px solid #eee;
}

.css-code {
    margin-top: 2rem;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.pattern-options-modal,
.enlarged-pattern-modal {
    border: none;
    border-radius: 10px;
    padding: 2rem;
    background: white;
}

.pattern-options-modal::backdrop,
.enlarged-pattern-modal::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.pattern-options-modal {
    position: relative;
}

.pattern-options-modal .close-modal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    z-index: 2;
}

.pattern-options-modal .options-container {
    padding-top: 40px;
}

.enlarged-pattern {
    width: 80vw;
    height: 80vh;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.buttons-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.show-code-btn,
.enlarge-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.show-code-btn {
    background-color: #007bff;
    color: white;
}

.show-code-btn:hover {
    background-color: #0056b3;
}

.enlarge-btn {
    background-color: #28a745;
    color: white;
}

.enlarge-btn:hover {
    background-color: #218838;
}

.pattern-details {
    animation: slideDown 0.3s ease-out;
}

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

.input-container {
    padding: 20px;
    text-align: center;
}

#user-input {
    width: 80%;
    max-width: 600px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.visit-section {
    text-align: center;
    margin: 2rem 0;
}

.visit-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.visit-button {
    position: relative;
    display: inline-block;
    padding:5px 30px;
    font-size: 1.2rem;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    color: #fff;
    border: none;
    background: linear-gradient(45deg, #ff7eb3, #ff758c, #fd3a69);
    background-size: 200% 200%;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.5s ease;
    text-decoration: none;
}

.visit-button:hover {
    background-position: 100% 0;
    animation: hover-lines 1s infinite;
    transform: none;
    box-shadow: none;
}

.visit-button:focus {
    background: conic-gradient(from 0deg, #ff7eb3, #ff758c, #fd3a69, #ff758c, #ff7eb3);
    animation: focus-shift 2s infinite alternate;
}

@keyframes hover-lines {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes focus-shift {
    0% { background-size: 100% 100%; }
    100% { background-size: 300% 300%; }
}

/* Contributors Section */
.contributors-section {
    padding: 4rem 2rem;
    margin-top: 4rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 20px;
}

.contributors-section h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.contributor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255,255,255,0.7);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.contributor h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.contributor p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #34495e;
    margin-bottom: 2rem;
}

.contributor .pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem;
    padding-left: 0;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .contributors-section {
        padding: 2rem 1rem;
    }

    .contributors-section h1 {
        font-size: 2rem;
    }

    .contributor h2 {
        font-size: 1.5rem;
    }

    .contributor .pattern-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

.contributor-link {
    text-align: center;
    margin: 2rem 0;
}

.contributor-link .visit-button {
    background: linear-gradient(45deg, #ff7eb3, #ff758c, #fd3a69);
    background-size: 200% 200%;
    box-shadow: none;
    border-radius: 8px;
    padding: 15px 30px;
}

.contributor-link .visit-button:hover {
    transform: none;
    background-position: 100% 0;
    animation: hover-lines 1s infinite;
}

.pattern-item:focus {
    outline: 5px dotted white;
    outline-offset: 2px;
}

.pattern-item:focus-within {
    outline: 5px dotted white;
    outline-offset: 2px;
    filter: brightness(1.1) hue-rotate(45deg);
} 