/* GitCover Mission - Extended Responsive & Accessibility Styles */

/* Advanced Media Queries für spezifische Geräte */

/* iPhone SE und kleine Smartphones */
@media screen and (max-width: 375px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.25rem;
    }
    
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.1;
    }
    
    .btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }
    
    .card {
        padding: var(--spacing-sm);
    }
    
    .card-icon {
        font-size: 2rem;
    }
}

/* Standard Smartphones (iPhone 12, Samsung Galaxy) */
@media screen and (min-width: 376px) and (max-width: 414px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .flex {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero .flex {
        flex-direction: column;
        align-items: center;
    }
}

/* Große Smartphones und kleine Tablets */
@media screen and (min-width: 415px) and (max-width: 767px) {
    .grid-3 {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
}

/* iPad und Tablets im Portrait-Modus */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .hero {
        padding: var(--spacing-xl) 0;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* Tablets im Landscape-Modus */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Desktop und große Bildschirme */
@media screen and (min-width: 1025px) {
    .container {
        max-width: 1200px;
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }
    
    .hero {
        padding: var(--spacing-xxl) 0;
    }
    
    .section {
        padding: var(--spacing-xxl) 0;
    }
}

/* Sehr große Bildschirme (4K, Ultrawide) */
@media screen and (min-width: 1440px) {
    :root {
        --spacing-xxl: 5rem;
    }
    
    .container {
        max-width: 1400px;
    }
    
    .hero h1 {
        font-size: 4rem;
    }
    
    .lead {
        font-size: 1.5rem;
    }
}

/* Spezielle Orientierungs-Anpassungen */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Landscape-Modus auf kleinen Bildschirmen (Smartphones horizontal) */
    .hero {
        padding: var(--spacing-md) 0;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero .lead {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #5dd3ca;
        --secondary-color: #4ecdc4;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --background-light: #1a1a1a;
        --background-section: #2d2d2d;
        --border-color: #404040;
    }
    
    .header {
        background: var(--background-light);
        border-bottom: 1px solid var(--border-color);
    }
    
    .card {
        background: var(--background-section);
        border: 1px solid var(--border-color);
    }
    
    .footer {
        background-color: #0d1117;
    }
}

/* High DPI / Retina Display Optimierungen */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .card-icon {
        text-rendering: optimizeLegibility;
    }
}

/* Barrierefreiheit - Erweiterte Fokus-Styles */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --secondary-color: #004499;
        --text-primary: #000000;
        --text-secondary: #333333;
        --background-light: #ffffff;
        --background-section: #f5f5f5;
        --border-color: #666666;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
    
    *:focus {
        outline: 3px solid #ffbf00;
        outline-offset: 2px;
    }
}

/* Reduzierte Bewegung für Nutzer mit Vestibular Disorders */
@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .btn {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Große Schrift für Sehbehinderte */
@media (min-resolution: 120dpi) and (prefers-contrast: high) {
    body {
        font-size: 18px;
    }
    
    .btn {
        font-size: 1.1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Touch-optimierte Größen für mobile Geräte */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: var(--spacing-sm) var(--spacing-lg);
    }
    
    .nav-link {
        min-height: 44px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .nav-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: var(--spacing-xs);
    }
    
    .card {
        cursor: pointer;
    }
}

/* Hover-fähige Geräte (Desktop mit Maus) */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
    
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
    
    .nav-link:hover {
        background-color: rgba(78, 205, 196, 0.1);
    }
}

/* Print-optimierte Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .hero {
        padding: 1rem 0;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .btn {
        border: 1px solid #ccc;
        padding: 0.5rem 1rem;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .nav,
    .nav-toggle,
    .footer {
        display: none;
    }
}

/* Spezielle Anpassungen für ältere Browser */
@supports not (display: grid) {
    .grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .grid > * {
        flex: 1 1 300px;
        margin: var(--spacing-sm);
    }
}

@supports not (gap: 1rem) {
    .grid > * {
        margin: var(--spacing-sm);
    }
    
    .flex > * {
        margin-right: var(--spacing-sm);
    }
    
    .flex > *:last-child {
        margin-right: 0;
    }
}

/* Container Queries (experimentell, für moderne Browser) */
@supports (container-type: inline-size) {
    .container {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .grid-2 {
            grid-template-columns: 1fr;
        }
    }
    
    @container (min-width: 800px) {
        .grid-3 {
            grid-template-columns: repeat(3, 1fr);
        }
    }
}
