/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-info .version {
    background: var(--light-bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.header-info .company {
    font-weight: 600;
    color: var(--primary-color);
}

/* Navigation */
.main-nav {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
}

.nav-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.nav-btn:hover:not(:disabled) {
    background: var(--light-bg);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-number {
    background: rgba(255, 255, 255, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.nav-btn.active .step-number {
    background: rgba(255, 255, 255, 0.3);
}

/* Main content */
main {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.screen h2 {
    margin-bottom: 25px;
    color: var(--text-primary);
    font-size: 20px;
}

/* Upload screen */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-box {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.upload-box h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-primary);
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-placeholder {
    color: var(--text-secondary);
}

.upload-icon {
    fill: var(--border-color);
    margin-bottom: 15px;
}

.file-upload-area:hover .upload-icon {
    fill: var(--primary-color);
}

.file-types {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.file-info {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    text-align: left;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    display: inline-block;
    margin-right: 10px;
}

.remove-file {
    float: right;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.file-details {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Settings screen */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.settings-section {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.settings-section h3 {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.column-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-range .column-select {
    width: 80px;
}

.column-select {
    width: 100px;
}

.advanced-settings {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.advanced-settings h3 {
    margin-bottom: 20px;
    font-size: 16px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-value {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 45px;
}

/* Results screen */
.statistics-panel {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.statistics h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.statistics ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.statistics li {
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.progress-bar {
    height: 30px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    margin-top: 15px;
}

.progress-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.progress-segment.exact {
    background: var(--success-color);
}

.progress-segment.similar {
    background: var(--warning-color);
}

.progress-segment.not-found {
    background: var(--danger-color);
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.filter-group,
.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
}

.search-group input {
    width: 250px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.results-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th {
    background: var(--light-bg);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.results-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-exact {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success-color);
}

.status-similar {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-notfound {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.annotation-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.action-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.action-btn:hover {
    background: var(--light-bg);
}

/* Export screen */
.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.export-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
}

.export-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.export-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.export-settings {
    margin-bottom: 20px;
}

.export-settings label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    cursor: pointer;
}

.export-settings input[type="checkbox"] {
    margin-right: 8px;
}

.info-text {
    font-style: italic;
}

.export-history {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.export-history h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

#export-history-list {
    font-size: 14px;
}

.export-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #15803d;
}

.btn-info {
    background: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background: #0284c7;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-message {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .upload-grid,
    .settings-grid,
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .results-toolbar {
        flex-direction: column;
    }
    
    .search-group input {
        width: 100%;
    }
    
    .main-nav {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        flex: 1 1 calc(50% - 5px);
    }
}

/* Utilities */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
