/**
 * OYROPA Professional Layout System
 * Einheitliches Design für Desktop & Mobile
 * Version 3.0 - Vollständige Layout-Standardisierung
 */

/* ==========================================
   RESET & FOUNDATION
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Prevent iOS text size adjust */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2D3748;
    background: #FFFFFF;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   PROFESSIONAL CONTAINER SYSTEM
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 30px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }
}

/* Safe area for mobile devices */
.container-mobile-safe {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

/* ==========================================
   HEADER STANDARDIZATION
   ========================================== */

header {
    background: #1A365D;
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    padding: 15px 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #FFFFFF;
}

.header-logo svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.header-nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-nav a:hover,
.header-nav a.active {
    background: rgba(214, 158, 46, 0.2);
    color: #D69E2E;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .header-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #1A365D;
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

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

    .header-nav a {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 18px;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */

main {
    min-height: calc(100vh - 70px - 200px); /* Header & Footer heights */
    padding: 40px 0;
}

@media (max-width: 768px) {
    main {
        padding: 20px 0;
    }
}

/* Section Spacing */
section {
    padding: 60px 0;
}

@media (max-width: 768px) {
    section {
        padding: 30px 0;
    }
}

/* ==========================================
   TYPOGRAPHY STANDARDIZATION
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1A365D;
}

h1 {
    font-size: clamp(28px, 4vw, 48px);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    margin-bottom: 1.25rem;
}

h3 {
    font-size: clamp(20px, 3vw, 28px);
    margin-bottom: 1rem;
}

h4 {
    font-size: clamp(18px, 2.5vw, 24px);
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Mobile Typography Fixes */
@media (max-width: 768px) {
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    p {
        font-size: 16px;
        line-height: 1.7;
    }
}

/* ==========================================
   CARD SYSTEM
   ========================================== */

.card {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
}

/* ==========================================
   BUTTON STANDARDIZATION
   ========================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-height: 44px; /* WCAG AA Touch Target */
    min-width: 44px;
}

.btn-primary {
    background: #1A365D;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #2C5282;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.btn-secondary {
    background: #D69E2E;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: #B7791F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 158, 46, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #1A365D;
    color: #1A365D;
}

.btn-outline:hover {
    background: #1A365D;
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 17px;
    }
}

/* ==========================================
   GRID SYSTEM
   ========================================== */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   FORM STANDARDIZATION
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2D3748;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: #FFFFFF;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1A365D;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

/* Mobile Form Fixes */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
}

/* ==========================================
   FOOTER STANDARDIZATION
   ========================================== */

footer {
    background: #2D3748;
    color: #FFFFFF;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #D69E2E;
    margin-bottom: 16px;
    font-size: 18px;
}

.footer-section a {
    color: #E5E7EB;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #D69E2E;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #9CA3AF;
}

@media (max-width: 768px) {
    footer {
        padding: 30px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ==========================================
   MOBILE-SPECIFIC FIXES
   ========================================== */

@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Safe padding for all sections */
    section > * {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Tables responsive */
    table {
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Spacing */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }
.p-5 { padding: 3rem !important; }

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flexbox */
.flex-column { flex-direction: column !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }

/* Colors */
.text-primary { color: #1A365D !important; }
.text-secondary { color: #D69E2E !important; }
.text-white { color: #FFFFFF !important; }
.text-gray { color: #6B7280 !important; }

.bg-primary { background-color: #1A365D !important; }
.bg-secondary { background-color: #D69E2E !important; }
.bg-light { background-color: #F9FAFB !important; }
.bg-white { background-color: #FFFFFF !important; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important; }
.shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; }
.shadow-lg { box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important; }

/* Border Radius */
.rounded { border-radius: 4px !important; }
.rounded-lg { border-radius: 8px !important; }
.rounded-xl { border-radius: 12px !important; }
.rounded-full { border-radius: 9999px !important; }

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

/* Focus Styles */
*:focus-visible {
    outline: 2px solid #D69E2E;
    outline-offset: 2px;
}

/* Skip to Content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1A365D;
    color: #FFFFFF;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Only */
.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;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000000;
        background: #FFFFFF;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    a {
        color: #000000;
        text-decoration: underline;
    }
}