/* ============================================
   GKV-SV XML Konverter - Styles
   Angepasst mit RampenAssist Farbdesign
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* NEUE FARBPALETTE von RampenAssist (PWA 1) */
    --primary-color: #1A5A7F;
    --primary-dark: #0A2438;
    --primary-light: #6F9DB5;
    --accent-light: #A8DCF4;
    --accent-lighter: #DBEDF6;
    --accent-lightest: #C2E5F5;
    --neutral-dark: #5A6B79;
    --neutral-medium: #A7B1B8;
    --neutral-light: #DFE6EA;
    --background-color: #F8FAFB;
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    
    /* Sekundärfarben angepasst */
    --secondary-color: #A8DCF4;
    --secondary-dark: #6F9DB5;
    --accent-color: #A8DCF4;
    --light-color: #F8FAFB;
    --dark-color: #1F2937;
    --gray-light: #DFE6EA;
    --gray: #A7B1B8;
    --gray-dark: #5A6B79;
    
    /* Statusfarben */
    --success-color: #28A745;
    --error-color: #E74C3C;
    --warning-color: #FFC107;
    
    /* Design Tokens */
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #2c3e50;  /* Dunkler Hintergrund wie PWA 1 */
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--background-color); /* #F8FAFB */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.version {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 30px;
}

/* Sektionen */
.upload-section,
.format-selection,
.action-section,
.info-section {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.upload-section:hover,
.format-selection:hover,
.action-section:hover,
.info-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.icon {
    font-size: 1.2em;
    color: var(--primary-color);
}

/* Upload Header */
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.file-counter {
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Upload Label */
.upload-label {
    display: block;
    border: 3px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(26, 90, 127, 0.05);
    position: relative;
    overflow: hidden;
}

.upload-label:hover {
    background: rgba(26, 90, 127, 0.1);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.upload-label:active {
    transform: translateY(0);
}

.upload-text {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.upload-hint {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.file-name {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(26, 90, 127, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Format Selection */
.format-options {
    margin-bottom: 20px;
}

.format-select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-color);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A5A7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 90, 127, 0.2);
}

.format-select option {
    padding: 10px;
    font-size: 1rem;
}

/* HMV Struktur Anzeige */
.hmv-structure {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 15px 0;
    padding: 15px;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hmv-part {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    min-width: 120px;
}

.hmv-digits {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 3px;
}

.hmv-separator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
    padding: 0 5px;
}

.hmv-example {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.hmv-example code {
    background: var(--neutral-light);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

/* Action Section */
.convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(26, 90, 127, 0.3);
}

.convert-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.convert-btn:disabled {
    background: var(--neutral-medium);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.4rem;
}

/* Status Anzeige */
.status {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

.status.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
    animation: successPulse 2s ease;
}

.status.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.status.processing {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
    animation: processingPulse 1.5s infinite;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes processingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Progress Bar */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 10px;
    background: var(--neutral-light);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--neutral-medium);
    position: relative;
    padding-left: 20px;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.instructions {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.instructions h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.instructions li {
    padding: 8px 0;
    color: var(--text-primary);
}

.note {
    padding: 15px;
    background: rgba(26, 90, 127, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 25px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.pwa-info {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.copyright {
    font-size: 0.55rem;
    opacity: 0.85;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-section,
    .format-selection,
    .action-section,
    .info-section {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .hmv-structure {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .hmv-part {
        min-width: auto;
    }
    
    .hmv-separator {
        transform: rotate(90deg);
        padding: 5px 0;
    }
    
    .format-select {
        font-size: 1rem;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }
    
    header {
        padding: 30px 20px;
    }
    
    main {
        padding: 15px;
    }
    
    .upload-label {
        padding: 30px 15px;
    }
    
    .convert-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
}

/* Druckoptimierung */
@media print {
    .upload-label,
    .convert-btn,
    .format-select,
    footer {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
    }
    
    body {
        background: white;
        padding: 0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0A2438;
        --primary-dark: #05111c;
    }
    
    .status.success {
        border-width: 3px;
    }
    
    .status.error {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .upload-label:hover,
    .convert-btn:hover {
        transform: none;
    }
}

/* Zusätzliche CSS-Regel für die verbesserte Counter-Anzeige */
.file-counter {
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
    text-align: center;
    line-height: 1.3;
}

.file-counter small {
    font-size: 0.7rem;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
}