/* ============================================================================
   WESTERN MUSIK PORTAL - GEMEINSAMES CSS
   ============================================================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #8B4513;
    --primary-dark: #654321;
    --secondary: #D2691E;
    --accent: #FFD700;
    --light: #F5DEB3;
    --dark: #2F4F4F;
    --white: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray: #6C757D;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f5dc 0%, #fffaf0 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container & Layout */
.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(139, 69, 19, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Western Style Button */
.western-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid var(--accent);
}

.western-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 69, 19, 0.4);
}

.western-btn:active {
    transform: translateY(0);
}

.western-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

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

/* Main Content */
main {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    padding: 3rem 1.5rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="%238B4513" opacity="0.1"/></svg>'),
                linear-gradient(135deg, var(--white) 0%, var(--light) 100%);
    background-size: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--light);
    margin-top: 1rem;
}

.welcome-screen h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.welcome-screen p {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Panels */
.nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-panel.active {
    transform: translateX(0);
}

.nav-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Scrollable List */
.scroll-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

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

.scroll-list::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

.scroll-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.scroll-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* List Items */
.list-item {
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    color: var(--dark);
}

.list-item:hover {
    transform: translateX(5px);
    border-color: var(--secondary);
    background: linear-gradient(90deg, var(--white) 0%, var(--light) 100%);
}

.list-item.active {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.list-item-icon {
    font-size: 1.2rem;
}

/* PDF Preview Container */
.pdf-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 2px solid var(--light);
}

.pdf-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pdf-title {
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.pdf-controls {
    display: flex;
    gap: 0.75rem;
}

.pdf-buttons {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--accent);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.pdf-viewer-container {
    flex: 1;
    position: relative;
    min-height: 500px;
    background: var(--gray-light);
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--gray);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    flex-direction: column;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-header {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: flex-end;
}

.fullscreen-frame {
    flex: 1;
    width: 100%;
    border: none;
}

/* Path Display */
.path-display {
    background: var(--light);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--dark);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.path-item {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.path-item:hover {
    background: rgba(139, 69, 19, 0.1);
}

.path-separator {
    margin: 0 0.5rem;
    color: var(--secondary);
}

/* Mobile Footer */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 2px solid var(--light);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
}

.footer-btn {
    background: none;
    border: none;
    color: var(--gray);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    max-width: 100px;
}

.footer-btn.active {
    color: var(--primary);
}

.footer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.footer-btn .icon {
    font-size: 1.5rem;
}

.footer-btn .label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animation for list items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.list-item {
    animation: slideIn 0.3s ease-out forwards;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Form Elements */
input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    padding: 0.5rem;
    border: 2px solid var(--light);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
}

/* Alert/Notification Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    header {
        padding: 1.5rem 2rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 2rem;
    }
    
    .nav-panel {
        position: absolute;
        top: 120px;
        left: 2rem;
        width: 300px;
        height: calc(100vh - 200px);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    
    .pdf-container {
        margin-left: 340px;
        height: calc(100vh - 200px);
    }
    
    .mobile-footer {
        display: none;
    }
    
    .welcome-screen {
        margin-left: 340px;
        margin-top: 2rem;
    }
}

@media (max-width: 767px) {
    .welcome-screen {
        margin-top: 1rem;
        padding: 2rem 1rem;
    }
    
    .western-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .pdf-viewer-container {
        min-height: 400px;
    }
    
    /* Mobile Optimierungen */
    .nav-panel {
        z-index: 2000;
    }
    
    .fullscreen-overlay {
        z-index: 3000;
    }
    
    /* Touch-friendly buttons */
    .control-btn, .footer-btn, .western-btn {
        min-height: 44px; /* Apple's minimum touch target size */
    }
}

/* Print Styles */
@media print {
    .mobile-footer,
    .nav-panel,
    .control-btn,
    .fullscreen-overlay {
        display: none !important;
    }
    
    .pdf-container {
        border: none;
        box-shadow: none;
        margin: 0;
    }
    
    .pdf-header {
        background: white !important;
        color: black !important;
        border-bottom: 1px solid #ccc;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #000000;
        --primary-dark: #000000;
        --secondary: #333333;
        --accent: #ffff00;
        --light: #ffffff;
        --dark: #000000;
    }
    
    .western-btn, .control-btn, .nav-link {
        border: 3px solid var(--accent);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #d2691e;
        --primary-dark: #8b4513;
        --secondary: #ff8c00;
        --accent: #ffd700;
        --light: #2f2f2f;
        --dark: #f0f0f0;
        --white: #1a1a1a;
        --gray-light: #2a2a2a;
        --gray: #aaaaaa;
    }
    
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        color: #f0f0f0;
    }
    
    input, select, textarea {
        background: #2a2a2a;
        color: #f0f0f0;
        border-color: #444;
    }
}

/* Custom scrollbar for Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--gray-light);
}

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

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

/* Mobile Touch & Scroll Fixes */
@media (max-width: 767px) {
    .pdf-viewer-container {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
        height: calc(100vh - 200px);
    }
    
    .pdf-frame {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
        height: 100%;
        pointer-events: auto;
    }
    
    .scroll-list {
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
    }
    
    /* Allow touch events on all interactive elements */
    .list-item, 
    .control-btn, 
    .footer-btn,
    .nav-link,
    .western-btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    /* Fix for iOS Safari */
    @supports (-webkit-touch-callout: none) {
        .pdf-viewer-container {
            height: -webkit-fill-available;
        }
        
        body {
            min-height: -webkit-fill-available;
        }
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .list-item {
        min-height: 48px;
        padding: 14px 16px;
    }
    
    .control-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .footer-btn {
        min-height: 60px;
    }
    
    /* Disable hover effects on touch devices */
    .list-item:hover {
        transform: none;
    }
    
    .control-btn:hover {
        transform: none;
    }
}