/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   TAILWIND CUSTOM STYLES & UTILITIES
   ============================================ */

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

/* Sections fade in when visible */
section {
    opacity: 0;
    will-change: opacity;
    position: relative;
    z-index: 1;
}

section:first-of-type {
    opacity: 1;
}

header {
    z-index: 50 !important;
}

section.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}

/* Footer always visible, no animation */
footer {
    opacity: 1;
}

.glass {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-form {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.text-glow {
    text-shadow: 0 0 15px rgba(84, 68, 228, 0.5);
}

.blob {
    position: fixed;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(84, 68, 228, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.6;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html {
    margin: 0;
    padding: 0;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5444e4;
}

/* Firefox Scrollbar */
* {
    scrollbar-color: #5444e4 #0a0a0a;
    scrollbar-width: thin;
}

/* Mobile Menu */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0 4px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.mobile-menu.active {
    max-height: 500px;
}

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    transform: translateY(-2px);
}

/* Placeholder styling */
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="date"]::placeholder,
textarea::placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
    opacity: 1;
}

input[type="text"]::-webkit-input-placeholder,
input[type="email"]::-webkit-input-placeholder,
input[type="date"]::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
    opacity: 1;
}

input[type="text"]::-moz-placeholder,
input[type="email"]::-moz-placeholder,
input[type="date"]::-moz-placeholder,
textarea::-moz-placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
    opacity: 1;
}

input[type="text"]:-ms-input-placeholder,
input[type="email"]:-ms-input-placeholder,
input[type="date"]:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
}

/* Hack for date placeholder */
input[type="date"]:invalid::-webkit-datetime-edit {
    color: rgba(71, 85, 105, 0.6);
}

input[type="date"]:valid::-webkit-datetime-edit {
    color: white;
}

/* Macht das Kalender-Icon weiß und passt den Cursor an */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6; /* Leicht transparent für den Slate-Look */
    cursor: pointer;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

select {
    color: rgba(255, 255, 255, 0.9);
}

select option:first-child {
    color: rgba(71, 85, 105, 0.8);
}

select:invalid {
    color: rgba(71, 85, 105, 0.8);
}

/* Form error states */
input.input-error,
textarea.input-error,
select.input-error {
    border-color: #ef4444 !important;
    background-color: #0a0a0f !important;
}

input.input-error::placeholder,
textarea.input-error::placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
}

.input-error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
}

.input-error-message.show {
    display: block;
}

/* Button Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Link Hover Effects */
a {
    position: relative;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #5444e4;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 1000px 100%;
    animation: skeleton-loading 2s infinite;
    border-radius: 0.5rem;
}

/* Lazy Loading Images */
img[data-src] {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 1000px 100%;
    animation: skeleton-loading 2s infinite;
    min-height: 200px;
}

img[data-src].loaded {
    animation: fadeIn 0.4s ease-in-out forwards;
    background: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.bg-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%) !important;
    background-size: 1000px 100%;
    animation: skeleton-loading 2s infinite;
}

.bg-skeleton.loaded {
    animation: none;
    background: none !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .blob,
    header,
    footer,
    .contact-form {
        display: none;
    }
}

/* Performance - GPU Acceleration */
.glass,
.glass-strong,
.glass-form {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth Page Transitions */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Loading State */
.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error States */
.form-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.form-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    h3 {
        font-size: 1.5rem;
    }
}

/* Image Grid */
.image-grid img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image-grid img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Focus Visible for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5444e4;
    outline-offset: 2px;
}
/* Lightbox Gallery */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#lightbox.open {
    display: flex !important;
}

#lightbox-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    pointer-events: auto;
}

#lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    animation: fadeIn 0.3s ease-in-out forwards;
}

#lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 100000;
    transition: all 0.2s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-close .material-symbols-outlined {
    font-size: 32px;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 100000;
    transition: all 0.2s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-prev {
    left: -80px;
}

#lightbox-next {
    right: -80px;
}

/* Mobile: Place arrows on image */
@media (max-width: 768px) {
    #lightbox-prev {
        left: 10px;
    }

    #lightbox-next {
        right: 10px;
    }
}

#lightbox-prev .material-symbols-outlined,
#lightbox-next .material-symbols-outlined {
    font-size: 40px;
}

#lightbox button:hover {
    transform: scale(1.1);
}

#lightbox-close:hover {
    background-color: #ff4444 !important;
    border-radius: 4px;
}

#lightbox-counter {
    position: absolute;
    bottom: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100000;
    pointer-events: none;
}

.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}