/* Основные стили */
body {
    background-color: #f9f9f9;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

h1, h2 {
    color: #333;
}

h1 {
    font-size: 32px;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

input, button {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 18px;
    box-sizing: border-box;
}

button {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button.delete-btn {
    background-color: white;
    color: #dc3545;
    border: 1.5px solid #dc3545;
    margin-top: 8px;
}

button.delete-btn:hover {
    background-color: #fef2f2;
    border-color: #b91c1c;
    color: #b91c1c;
}

button:hover {
    opacity: 0.9;
}

.card .go-btn {
    background-color: white;
    color: #007BFF;
    border: 1.5px solid #007BFF;
    margin-top: 16px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.card .go-btn:hover {
    background-color: #f0f8ff;
    border-color: #0056b3;
    color: #0056b3;
}

.back-btn {
    margin-bottom: 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    display: block;
    text-align: center;
    border-radius: 5px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    width: auto;
}

.upload-photo-btn {
    background-color: transparent;
    color: #007BFF;
    border: 2px solid #007BFF;
    margin-right: 10px;
}

.delete-photo-btn {
    background-color: #FF6347;
    color: white;
}

/* Стили карточек клиентов */
.client-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 0;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f3f4f6;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-content form {
    margin-top: 0;
}

.card .client-id {
    font-weight: bold;
    color: #999;
    margin-right: 10px;
}

.client-header h1 {
    margin: 0;
    font-size: 36px;
    text-align: center;
}

.client-header p {
    margin: 5px 0;
    text-align: center;
}

.client-section h2 {
    text-align: left;
}

.file-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.card a {
    text-decoration: none;
    color: #007BFF;
    font-weight: bold;
}

.card button {
    align-self: flex-end;
    background-color: #FF6347;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

/* Стили страницы клиента */
.client-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.client-photo {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    cursor: pointer;
}

.client-photo img {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    margin-top: 10px;
    cursor: pointer;
}

.client-photo form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

a {
    text-decoration: none;
    color: #007BFF;
    font-weight: bold;
    display: inline-block;
    margin-top: 20px;
}

ul {
    padding: 0;
}

li {
    list-style-type: none;
}

@media (max-width: 600px) {
    h1 {
        font-size: 24px;
    }

    input, button {
        font-size: 16px;
        padding: 12px;
    }

    .container {
        max-width: 1000px;
        margin: 0 auto;
        padding: 20px;
        box-sizing: border-box;
    }

    .client-list {
        grid-template-columns: 1fr;
    }
}

/* Стили модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    margin: 15% auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal .close:hover,
.modal .close:focus {
    color: #bbb;
}

#modalImage {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    height: auto;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.client-name {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 4px;
}

.client-address {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.client-id {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.02em;
}

.client-tour {
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
}

.client-delivery-time {
    font-size: 13px;
    color: #6b7280;
}

.card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.error-messages {
    list-style-type: none;
    padding: 0;
    color: red;
    text-align: center;
}

.error-message {
    color: red;
}

.centered-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.client-section.notiz-card {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.notiz-card h2 {
    text-align: left;
    font-size: 24px;
    margin-bottom: 10px;
}

.notiz-card p {
    font-size: 16px;
    color: #333;
    white-space: pre-wrap; /* сохраняет пробелы и переносы строк */
}

.modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    margin-top: 10px;
    resize: vertical; /* позволяет изменять высоту, но не ширину */
}

/* Стили для дополнительных фотографий и кнопки добавления фотографии */
.additional-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.additional-photo img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    margin-bottom: 10px;
}

.client-section .btn {
    margin-top: 10px;
    background-color: #007BFF; /* Кнопка добавления фотографии будет синей */
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
}

.client-section .btn:hover {
    opacity: 0.9;
}

/* Стили для модального окна добавления фотографии */
#addPhotoModal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

#addPhotoModal .modal-content {
    margin: 15% auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#addPhotoModal .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#addPhotoModal .close:hover,
#addPhotoModal .close:focus {
    color: #bbb;
}

#addPhotoModal input[type="text"],
#addPhotoModal input[type="file"],
#addPhotoModal .btn {
    width: 100%;
    margin-bottom: 10px;
}

#addPhotoModal .btn {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
}

#addPhotoModal .btn:hover {
    opacity: 0.9;
}


button.edit-btn {
    background-color: #6c757d; /* серый цвет для кнопки Edit */
    color: white;
}

button.delete-photo-btn {
    background-color: #FF6347 !important;
    color: white !important;
    border: none !important;
    padding: 10px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}

button.delete-photo-btn:hover {
    opacity: 0.9 !important;
}

/* Стили для поля поиска */
#search {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 18px;
    box-sizing: border-box;
    margin: 20px 0px;
}

.logo-container {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.logo-div {
margin-bottom: 80px
}

.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
}

.loader::before {
    content: 'Loading...';
    position: absolute;
    top: calc(50% + 40px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: #3498db;
}

.loader::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Стили для модального окна доставки */
#deliveryModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

#deliveryModal .modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#deliveryModal h2 {
    margin-top: 0;
}

#deliveryModal #deliveryDateTime {
    font-size: 18px;
    margin-bottom: 20px;
}

#deliveryModal .file-input {
    margin-bottom: 10px;
}

#deliveryModal .btn {
    margin-top: 10px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
    #deliveryModal .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* Стили для кнопки "Geliefert" */
.delivery-btn {
    background-color: #28a745;
    color: white;
    margin: 10px auto;
    display: block;
    width: 200px;
    font-size: 18px;
    padding: 15px 0;
}

.delivery-btn:hover {
    background-color: #218838;
}

/* Стили для модального окна отображения последней доставки */
#lastDeliveryModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

#lastDeliveryModal .modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#lastDeliveryModal h2 {
    margin-top: 0;
    text-align: center;
}

#lastDeliveryModal p {
    font-size: 18px;
    margin-bottom: 20px;
}

#lastDeliveryModal .delivery-photo {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
    #lastDeliveryModal .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

#lastDeliveryInfo {
    margin-top: 10px;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

#filterForm {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

#filterForm input, #filterForm button {
    padding: 5px;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 10px 0;
}

.view-toggle-btn {
    padding: 10px 24px;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #4b5563;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.view-toggle-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.view-toggle-btn.active {
    background-color: #007BFF;
    color: white;
    border-color: #007BFF;
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.2);
}

/* Excel Export Link */
.excel-export-container {
    text-align: right;
    margin: 8px 0 20px 0;
}

.excel-export-link {
    color: #007BFF;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.excel-export-link:hover {
    opacity: 0.7;
    text-decoration: none;
}

/* Map Container Styles */
#mapContainer {
    width: 100%;
    height: 600px;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#map {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments for map */
@media (max-width: 600px) {
    #mapContainer {
        height: 400px;
    }

    .view-toggle {
        flex-direction: column;
    }

    .view-toggle-btn {
        width: 100%;
    }
}

/* Completion Badge Styles - Apple-style dot indicators */
.completion-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: help;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 2px white, 0 1px 3px rgba(0, 0, 0, 0.1);
}

.completion-badge:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px white, 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Completion Badge Color States */
.completion-badge.bright-green {
    background-color: #10b981;
}

.completion-badge.pale-green {
    background-color: #34d399;
}

.completion-badge.yellow {
    background-color: #fbbf24;
}

.completion-badge.grey {
    background-color: #9ca3af;
}

/* Tour Filter Panel Styles */
#tourFilterPanel {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tour-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tour-filter-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.tour-filter-buttons {
    display: flex;
    gap: 8px;
}

.tour-filter-buttons button {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#selectAllTours {
    background: white;
    color: #10b981;
    border-color: #10b981;
}

#selectAllTours:hover {
    background: #f0fdf4;
}

#deselectAllTours {
    background: white;
    color: #ef4444;
    border-color: #ef4444;
}

#deselectAllTours:hover {
    background: #fef2f2;
}

#tourCheckboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 2px;
}

#tourCheckboxes label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
    transition: all 0.2s ease;
}

#tourCheckboxes label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

#tourCheckboxes input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#tourCheckboxes span:last-child {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}