/* 
 * Additional Responsive & Animation Styles
 * Interkulturelle Denkfabrik Theme
 */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading State */
body:not(.loaded) {
    overflow: hidden;
}

body.loaded {
    overflow-x: hidden;
}

/* Header Scroll States */
.custom-header.scroll-down {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.custom-header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-dark);
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: white;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 999;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 20px;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
}

/* Tablet Optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .slide {
        gap: 20px;
    }

    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 36px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }

    .hero-section {
        padding: 40px 0;
    }

    .event-slider {
        padding: 0 20px;
    }

    .slider-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .slider-nav.prev {
        left: 10px;
    }

    .slider-nav.next {
        right: 10px;
    }

    .slide-content {
        padding: 20px;
    }

    .slide-title {
        font-size: 18px;
    }

    .highlights-section {
        padding: 0 20px 60px;
    }

    .highlight-content {
        padding: 20px;
    }

    .highlight-title {
        font-size: 16px;
    }

    .date-badge {
        width: 60px;
        height: 60px;
        top: 10px;
        left: 10px;
    }

    .date-month {
        font-size: 12px;
    }

    .date-year {
        font-size: 14px;
    }

    .newsletter-section {
        padding: 60px 20px;
    }

    .newsletter-title {
        font-size: 28px;
    }

    .newsletter-subtitle {
        font-size: 14px;
    }

    .newsletter-input,
    .newsletter-button {
        padding: 15px 25px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo-brain {
        width: 100px;
    }

    .section-title {
        font-size: 24px;
        margin: 40px 0 30px;
    }

    .newsletter-title {
        font-size: 22px;
    }

    .project-mini-grid {
        gap: 15px;
    }
}

/* Print Styles */
@media print {
    .custom-header,
    .slider-nav,
    .slider-dots,
    .newsletter-section,
    .projects-sidebar,
    .custom-footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .highlight-card,
    .slide-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
.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;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--color-magenta);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-magenta);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}

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

    .category-tag,
    .project-mini-tag {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .slider-wrapper {
        transition: none;
    }

    .deco-shape {
        transform: none !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    body {
        background: var(--color-dark);
        color: var(--color-light);
    }

    .custom-header {
        background: #2A2A3E;
    }

    .slide-card,
    .highlight-card,
    .project-mini-card {
        background: #2A2A3E;
    }
    */
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }

    .slide-image {
        height: 180px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .highlight-card:hover,
    .slide-card:hover,
    .project-mini-card:hover {
        transform: none;
    }

    .slider-nav:hover {
        transform: translateY(-50%);
    }

    /* Larger touch targets */
    .slider-nav {
        width: 60px;
        height: 60px;
    }

    .dot {
        width: 16px;
        height: 16px;
    }
}

/* Image Loading States */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-magenta);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c1006a;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-magenta) #f1f1f1;
}

/* Selection Color */
::selection {
    background: var(--color-magenta);
    color: white;
}

::-moz-selection {
    background: var(--color-magenta);
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-message {
    background: #f44336;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message {
    background: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Container Widths */
.container-fluid {
    width: 100%;
    padding-left: 40px;
    padding-right: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
}

@media (max-width: 768px) {
    .container-fluid,
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}
