* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.subtitle {
    opacity: 0.9;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

nav {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    display: inline-block;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#search, #category-filter, #driver-name, #driver-category, #driver-version, #driver-os {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

#search {
    padding-left: 40px;
    width: 350px;
}

#category-filter {
    min-width: 200px;
    cursor: pointer;
}

.stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

#drivers-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.driver-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.driver-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.card-header h3 {
    margin: 0;
    flex: 1;
    margin-right: 0.5rem;
    color: #667eea;
    font-size: 1.1rem;
}

.driver-card .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.driver-card .info {
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.driver-card .info p {
    margin-bottom: 0.25rem;
}

.upload-date {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    margin-top: 0.5rem;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.system-badge {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.download-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 0.5rem;
    transition: background 0.3s;
    text-align: center;
    font-weight: 500;
}

.download-btn:hover {
    background: #764ba2;
}

/* Модальное окно подтверждения */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-content h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-delete-confirm {
    background: #dc3545;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete-confirm:hover {
    background: #c82333;
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* Секция загрузки */
.upload-section {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.upload-header {
    margin-bottom: 2rem;
}

.upload-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.upload-header p {
    color: #666;
    font-size: 0.9rem;
}

#upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

#upload-form input, #upload-form select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#upload-form input:focus, #upload-form select:focus {
    outline: none;
    border-color: #667eea;
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#file-name {
    font-weight: 500;
    color: #667eea;
}

.file-types {
    font-size: 0.8rem;
    color: #999;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.upload-btn, .clear-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.clear-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.clear-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

#upload-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    display: none;
}

#upload-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

#upload-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

/* Состояние пустого результата */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #999;
}

/* Футер */
footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    margin: 0.25rem 0;
}

.footer-info {
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    #search {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats {
        width: 100%;
        text-align: center;
    }
    
    .driver-card {
        margin: 0 1rem;
    }
    
    .upload-section {
        margin: 2rem 1rem;
    }
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}