/* ========================================
   AeDL-ZIS Transformationstool
   Modern Dark Theme with Teal Accents
   ======================================== */

:root {
    /* Color Palette - Deep Ocean Theme */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #151d2e;
    --bg-hover: #1e2a42;
    
    /* Accent Colors */
    --accent-primary: #14b8a6;
    --accent-secondary: #0d9488;
    --accent-glow: rgba(20, 184, 166, 0.3);
    --accent-subtle: rgba(20, 184, 166, 0.1);
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border */
    --border-color: #2d3a52;
    --border-accent: var(--accent-primary);
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ========================================
   Reset & Base
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   Layout
   ======================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Header
   ======================================== */

.header {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-left: 48px;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 48px;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-subtle);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.header-actions {
    margin-left: auto;
}

.card-body {
    padding: 24px;
}

/* Info Section */
.info-section .card-header {
    cursor: pointer;
}

.info-section .card-header:hover {
    background: var(--bg-hover);
}

.info-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.btn-collapse {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-collapse:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-collapse svg {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.btn-collapse.collapsed svg {
    transform: rotate(180deg);
}

.info-content {
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.info-content.collapsed {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.info-block {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-block h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.info-block p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-block strong {
    color: var(--text-primary);
}

.info-steps {
    margin-bottom: 24px;
}

.info-steps h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.info-steps ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-steps li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.info-steps li:hover {
    border-color: var(--accent-primary);
}

.info-steps .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 50%;
}

.info-steps li div strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.info-steps li div p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.info-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
}

.info-note svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: var(--accent-primary);
    margin-top: 2px;
}

.info-note p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.info-note strong {
    color: var(--accent-primary);
}

/* Step Badge */
.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Dropzone
   ======================================== */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition-normal);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-subtle);
}

.dropzone.drag-over {
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

.dropzone:hover .dropzone-icon {
    transform: translateY(-4px);
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dropzone-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.file-info svg {
    width: 24px;
    height: 24px;
    color: var(--success);
    flex-shrink: 0;
}

.file-info span {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ========================================
   Forms
   ======================================== */

.config-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Export Options */
.export-options {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.export-options h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.radio-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: var(--transition-fast);
    margin-top: 2px;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--accent-primary);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ .radio-label strong {
    color: var(--accent-primary);
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-label strong {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.radio-label small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Person Selection */
.person-selection {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

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

.person-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.person-selection-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.person-selection-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-link:hover {
    background: var(--accent-subtle);
    text-decoration: underline;
}

.divider {
    color: var(--text-muted);
}

.person-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.person-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.person-checkbox:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.person-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition-fast);
}

.person-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.person-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.person-checkbox .person-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-checkbox .entry-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.person-checkbox input[type="checkbox"]:checked ~ .person-name {
    color: var(--accent-primary);
}

.person-selection-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.person-selection-footer span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(34, 197, 94, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--error-bg);
    color: var(--error);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Data Table
   ======================================== */

.record-count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    background: var(--accent-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.table-container {
    overflow-x: auto;
    margin: -8px;
    padding: 8px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Export Actions */
.export-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-card), var(--success-bg));
}

.toast.error {
    border-color: var(--error);
    background: linear-gradient(135deg, var(--bg-card), var(--error-bg));
}

.toast.warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-card), var(--warning-bg));
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--error); }
.toast.warning svg { color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ========================================
   Footer
   ======================================== */

.footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .app-container {
        padding: 0 16px;
    }
    
    .header {
        padding: 24px 0;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .header-subtitle {
        margin-left: 0;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .dropzone {
        padding: 32px 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .export-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .export-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Loading State
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Scrollbar Styling
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
