/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка сайта */
.header {
    background: linear-gradient(to bottom, #003366 0%, #002244 100%);
    color: white;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.logo img {
    height: 24px;
    width: auto;
}

.logo span {
    font-size: 13px;
    font-weight: normal;
    opacity: 0.95;
    white-space: nowrap;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
    margin-left: 40px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.main-nav a:hover {
    opacity: 1;
}

.user-info {
    display: flex;
    align-items: center;
}

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

.username {
    font-size: 12px;
    opacity: 0.85;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    padding-right: 16px;
}

.username::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.7;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.85;
    border-radius: 2px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

/* Основной контент */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
}

/* Заголовок страницы */
.page-title {
    display: flex;
    align-items: center;
    margin: 16px 0;
    gap: 24px;
}

.page-title h1 {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
}

.tabs {
    display: flex;
    gap: 24px;
}

.tab {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 0;
    position: relative;
    text-transform: uppercase;
}

.tab.active {
    color: #003366;
    font-weight: bold;
}

.tab.inactive {
    color: #999;
    cursor: default;
}

/* Разделы поиска */
.search-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    width: 100%;
}

.search-section {
    flex: 1;
    min-width: 0;
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.section-title {
    color: #CC0000;
    font-size: 16px;
    font-weight: bold;
}

.clear-btn {
    background-color: white;
    border: 1px solid #003366;
    color: #003366;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 3px;
}

.search-form {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.search-btn {
    background-color: #003366;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
}

/* Параметры поиска */
.search-params {
    display: none;
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 3px;
    font-size: 13px;
    color: #666;
}

/* Результаты поиска */
.search-results {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.driver-result, .vehicle-result {
    display: flex;
    gap: 30px;
}

.driver-photo {
    flex: 0 0 120px;
    height: 150px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
}

.driver-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.driver-info, .vehicle-info {
    flex: 1;
    min-width: 0;
}

.driver-name, .vehicle-name {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.driver-name-text, .vehicle-name-text {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.status {
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
    color: white;
}

.driver-details, .vehicle-details {
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-details div, .vehicle-details div {
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
}

.driver-details span, .vehicle-details span {
    color: #666;
    font-weight: bold;
    min-width: 120px;
}

.driver-checks, .vehicle-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

.check-value {
    color: #2ECC71;
}

input[type="color"] {
    width: 100%;
    height: 35px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
}

/* Улучшения для мобильных устройств */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Дополнительный медиа-запрос для адаптации форм */
@media screen and (max-width: 600px) {
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 6px;
        font-size: 13px;
    }
    
    form button {
        padding: 7px 12px;
        font-size: 13px;
    }
}

/* Анимация загрузки */
.loading-container {
    display: none;
    position: relative;
    width: 100%;
    height: 3px;
    background-color: #e9ecef;
    margin: 10px 0;
    overflow: hidden;
}

.loading-bar {
    position: absolute;
    width: 30%;
    height: 100%;
    background-color: #4a90e2;
    animation: loading 1s infinite linear;
    background: linear-gradient(90deg, 
        rgba(74, 144, 226, 0) 0%,
        rgba(74, 144, 226, 0.6) 50%,
        rgba(74, 144, 226, 0) 100%
    );
}

@keyframes loading {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Эффект размытия для модального окна входа */
#login-modal {
    backdrop-filter: blur(5px);
}

#login-modal .modal-content {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 4px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #003366;
    font-size: 18px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

form button {
    background-color: #003366;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    margin-top: 10px;
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.admin-tab {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.admin-tab.active {
    font-weight: bold;
    color: #003366;
    border-bottom: 2px solid #003366;
}

.admin-tab-content {
    display: none;
}

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

/* Адаптивный дизайн */
@media screen and (max-width: 1200px) {
    .header-content, .main-content {
        padding: 0 15px;
    }
    
    .search-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .search-section {
        width: 100%;
        max-width: 800px;
    }
}

@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    .main-nav ul {
        gap: 15px;
        margin-left: 0;
        margin-bottom: 10px;
        justify-content: center;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .page-title {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .driver-result, .vehicle-result {
        flex-direction: column;
        align-items: center;
    }
    
    .driver-photo {
        margin-bottom: 15px;
    }
    
    .modal-content {
        padding: 15px;
        width: 95%;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .admin-tab {
        padding: 10px;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .driver-details, .vehicle-details {
        flex-direction: column;
    }
    
    .driver-checks, .vehicle-checks {
        flex-direction: column;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .modal-content {
        padding: 10px;
    }
    
    .username {
        font-size: 11px;
    }
    
    .logout-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Информационные сообщения */
.info-message {
    background-color: #f8f9fa;
    border-left: 4px solid #003366;
    padding: 15px;
    margin: 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.info-message p {
    margin-bottom: 5px;
}

.info-message p:last-child {
    margin-bottom: 0;
}

/* Стили для чекбоксов */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    margin-right: 8px;
    width: auto;
}

/* Список хелперов */
.helpers-list-container {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.helpers-list-container h3 {
    font-size: 16px;
    color: #003366;
    margin-bottom: 15px;
}

.helpers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.helper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #003366;
}

.helper-info {
    flex: 1;
}

.helper-name {
    font-weight: bold;
    margin-bottom: 3px;
    color: #333;
}

.helper-username {
    font-size: 13px;
    color: #666;
}

.helper-permissions {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.delete-helper-btn {
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.delete-helper-btn:hover {
    background-color: #aa0000;
}

.no-helpers {
    color: #666;
    font-style: italic;
    padding: 10px;
}

.info-note {
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    border-radius: 4px;
    font-size: 13px;
}

.info-note p {
    margin: 5px 0;
    color: #495057;
}

.submit-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #0b5ed7;
}

.debug-btn {
    margin-bottom: 10px;
    padding: 5px 10px;
    background-color: #ff5555;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
}

.debug-btn:hover {
    background-color: #ff0000;
} 