/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Badge Styles for Acceptance Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin: 15px 0;
    font-size: 0.9rem;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge i {
    font-size: 1.2em;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    overflow: visible;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    position: relative;
    overflow: visible;
}

.header-content h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.header-content h1 i {
    color: #667eea;
    margin-right: 15px;
}

.header-content p {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
}

.section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.section h2 i {
    color: #667eea;
    margin-right: 10px;
}

.section-description {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Analysis Mode Selector */
.analysis-mode-selector {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.mode-selector-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.mode-selector-label i {
    color: #667eea;
    margin-right: 8px;
}

.mode-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.mode-dropdown:hover {
    border-color: #667eea;
}

.mode-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mode-description {
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.description-text {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.description-text i {
    color: #667eea;
    margin-right: 8px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 60px 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
    color: #667eea;
}

.upload-content h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.browse-link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.file-types {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.file-type {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Progress Bar */
.upload-progress {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-weight: 500;
}

/* File Info */
.file-info {
    margin-top: 30px;
    padding: 25px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.file-details {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.file-details i {
    font-size: 2rem;
    color: #667eea;
    margin-right: 15px;
}

.file-meta h4 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.file-meta p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.analysis-options h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.analysis-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

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

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #2c3e50;
    font-weight: 500;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Analysis Section */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.analysis-progress {
    text-align: center;
    padding: 60px 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.results-container {
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.results-header h3 i {
    color: #667eea;
    margin-right: 10px;
}

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

.metric-card {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.metric-label {
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.metric-grade {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}



/* Details Section */
.details-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 25px;
}

.details-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.assessment {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
    color: #2c3e50;
}

.output-text {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    color: #e74c3c;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #bdc3c7;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #ecf0f1;
    text-align: right;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .analysis-buttons {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .analysis-header,
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .upload-content h3 {
        font-size: 1.2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grade Colors - Matching validate_dwc.py semaphore system */
.grade-a { background: linear-gradient(135deg, #2ecc71, #27ae60); color: white; } /* 🟢 Green - Hervorragende Konformität (≥80) */
.grade-b { background: linear-gradient(135deg, #2ecc71, #27ae60); color: white; } /* 🟢 Green - Gute Grundlage (≥60) */
.grade-c { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; } /* 🟡 Yellow - Verbesserungsbedarf (≥40) */
.grade-d { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; } /* 🔴 Red - Dringend erforderliche Verbesserungen (<40) */
.grade-f { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; } /* 🔴 Red - Dringend erforderliche Verbesserungen (<40) */

/* Intro.js Tour Button */
.tour-button {
    position: fixed !important;
    top: 80px !important;
    right: 20px !important;
    background: #2d5016 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    z-index: 10000 !important;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.4) !important;
    animation: pulse 2s ease-in-out infinite !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(45, 80, 22, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(45, 80, 22, 0.6);
    }
}

.tour-button:hover {
    background: #1f3a0f;
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.5);
    transform: translateY(-1px) scale(1.05);
    animation: none;
}

.tour-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(45, 80, 22, 0.4);
    animation: none;
}

.tour-button i {
    font-size: 16px;
}

/* Intro.js Step 2 - Move tooltip down */
#analyze-darwin-core[data-step="2"] ~ * .introjs-tooltip,
.introjs-tooltip[data-step="2"],
.introjs-showElement[data-step="2"] + .introjs-tooltipReferenceLayer .introjs-tooltip {
    margin-top: 100px !important;
}

/* Alternative: Target tooltip when step 2 is active */
.introjs-tooltip:has(+ .introjs-helperLayer [data-step="2"]) {
    margin-top: 100px !important;
}

/* Target tooltip for step 2 and step 3 using JavaScript data attribute - Center it on screen */
.introjs-tooltip[data-current-step="2"],
.introjs-tooltip[data-current-step="3"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 100000001 !important;
    max-width: 800px !important;
    min-width: 700px !important;
    width: auto !important;
}

/* Ensure tooltip text inside step 2 and step 3 is wide enough */
.introjs-tooltip[data-current-step="2"] .introjs-tooltiptext,
.introjs-tooltip[data-current-step="3"] .introjs-tooltiptext {
    max-width: 100% !important;
    width: 100% !important;
    padding: 20px 25px !important;
}

/* Popup card 4 (step 3) - Completely white background, no transparency */
.introjs-tooltip[data-current-step="3"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

.introjs-tooltip[data-current-step="3"] .introjs-tooltip-header,
.introjs-tooltip[data-current-step="3"] .introjs-tooltiptext {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

/* Also center the tooltip reference layer for step 2 and step 3 */
.introjs-tooltipReferenceLayer[data-current-step="2"],
.introjs-tooltipReferenceLayer[data-current-step="3"],
.introjs-tooltipReferenceLayer:has(.introjs-tooltip[data-current-step="2"]),
.introjs-tooltipReferenceLayer:has(.introjs-tooltip[data-current-step="3"]) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
    height: auto !important;
}

/* Hide helper layer for step 2 and step 3 to prevent positioning conflicts */
.introjs-helperLayer:has([data-step="2"]),
.introjs-helperLayer:has([data-step="3"]) {
    display: none !important;
}

/* Intro.js Step 3 - Move tooltip up and to the right */
#upload-area[data-step="3"] ~ * .introjs-tooltip,
.introjs-tooltip[data-step="3"],
.introjs-showElement[data-step="3"] + .introjs-tooltipReferenceLayer .introjs-tooltip {
    margin-top: -80px !important;
    margin-left: 200px !important; /* Move significantly to the right */
}

/* Alternative: Target tooltip when step 3 is active */
.introjs-tooltip:has(+ .introjs-helperLayer [data-step="3"]) {
    margin-top: -80px !important;
    margin-left: 200px !important; /* Move significantly to the right */
}

/* Target tooltip for step 3 using JavaScript data attribute */
/* Note: JavaScript uses 0-indexed steps, so step 3 = index 2 */
.introjs-tooltip[data-current-step="3"],
.introjs-tooltip[data-current-step="2"] {
    margin-top: -80px !important;
    margin-left: 200px !important; /* Move significantly to the right */
}

/* Intro.js Skip Button - Custom Styling (applies to all tour steps) */
/* Hide skip button in header */
.introjs-tooltip-header .introjs-skipbutton {
    display: none !important;
}

/* Ensure tooltip text is fully visible - no truncation */
.introjs-tooltip {
    max-width: 600px !important;
    min-width: 300px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Override for step 2 - much wider */
.introjs-tooltip[data-current-step="1"],
.introjs-tooltip[data-current-step="2"] {
    max-width: 800px !important;
    min-width: 700px !important;
}

.introjs-tooltiptext {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    line-height: 1.5 !important;
    display: block !important;
    text-overflow: clip !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: unset !important;
}

/* Ensure tooltip container doesn't clip content */
.introjs-tooltipReferenceLayer {
    overflow: visible !important;
}

/* Prevent any text truncation in tooltip */
.introjs-tooltip * {
    text-overflow: clip !important;
}

/* Style for skip button when moved to new position */
.introjs-tooltip .introjs-skipbutton {
    font-size: 13px !important;
    line-height: 1.3 !important;
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 12px auto 8px !important;
    text-align: center !important;
    padding: 6px 15px !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
}

@media (max-width: 768px) {
    .tour-button {
        position: fixed !important;
        top: 80px !important;
        right: 20px !important;
        width: auto !important;
        margin-top: 0 !important;
        justify-content: center !important;
    }
}

