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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 10px;
}

header p {
    font-size: 16px;
    opacity: 0.9;
}

.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-switch a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 14px;
}

.lang-switch a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.input-section {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
}

.tab.active {
    color: #667eea;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.file-upload {
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.file-upload.dragover {
    border-color: #667eea;
    background: #ede9fe;
}

.file-upload input[type="file"] {
    display: none;
}

.file-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #9ca3af;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
    text-align: left;
}

.file-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #6b7280;
}

.algorithms-section {
    margin-bottom: 30px;
}

.algorithms-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #374151;
}

.algorithm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.algorithm-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.algorithm-checkbox:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.algorithm-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.algorithm-checkbox label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.calculate-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.clear-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.clear-btn:hover {
    background: #e5e7eb;
}

.results-section {
    display: none;
}

.results-section.show {
    display: block;
}

.result-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-item h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    word-break: break-all;
    color: #1f2937;
    line-height: 1.6;
}

.copy-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #667eea;
    color: white;
}

.copy-btn:hover {
    background: #5a67d8;
}

.copy-btn.copied {
    background: #10b981;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

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

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

.compare-section { margin-bottom: 20px; }
.compare-section h3 { font-size: 16px; margin-bottom: 10px; color: #374151; }
.compare-input { width: 100%; padding: 12px; border: 2px solid #e5e7eb; border-radius: 8px; font-family: 'Consolas', monospace; font-size: 14px; }
.compare-input:focus { outline: none; border-color: #667eea; }
.match-result { margin-top: 8px; padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.match-result.match { background: #d4edda; color: #155724; }
.match-result.no-match { background: #f8d7da; color: #721c24; }

footer {
    margin-top: 40px;
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 14px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 28px;
    }

    .main-content {
        padding: 20px;
    }

    .algorithm-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .action-buttons {
        flex-direction: column;
    }

    .lang-switch {
        top: 10px;
        right: 10px;
    }
}
