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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4; /* Reduced from 1.6 */
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer {
    flex-shrink: 0;
}

/* Header */
.header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1rem;
    margin-bottom: 1rem;
}

nav li {
    display: inline-flex;
}

/* Navigation Links */
.nav-link {
    position: relative;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* Add Content Link */
.add-tour-link {
    background: linear-gradient(135deg, #28a745 0%, #38c172 100%);
}

.add-tour-link:hover {
    background: linear-gradient(135deg, #218838 0%, #2e9b57 100%);
    transform: scale(1.05);
}

/* Main Container */
.main-content {
    background: white;
    margin: 40px auto 2rem;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative;
    z-index: 3;
}

/* Admin Link */
.admin-link {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

/* Tours Container */
.tours-container {
    transition: all 0.5s ease;
}

/* List View */
.tours-list .tour-item {
    display: flex;
    background: white;
    border-radius: 15px;
    margin-bottom: 1rem; /* Reduced from 2rem */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.tours-list .tour-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.tours-list .tour-image {
    width: 300px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 15px 0 0 15px;
}

.tours-list .tour-content {
    flex: 1;
    padding: 1rem; /* Reduced from 2rem */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tours-list .tour-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

.tours-list .tour-description {
    color: #666;
    line-height: 1.4; /* Reduced from 1.6 */
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.tours-list .tour-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

/* Cards View */
.tours-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem; /* Reduced from 2rem */
}

.tours-cards .tour-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    flex-direction: column;
}

.tours-cards .tour-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.tours-cards .tour-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.tours-cards .tour-content {
    padding: 1rem; /* Reduced from 2rem */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tour-description {
    flex-grow: 1;
}

.tour-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

.tour-description {
    color: #666;
    line-height: 1.4; /* Reduced from 1.6 */
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.tour-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

/* Кнопка "Подробнее" (Facebook) */
.facebook-btn {
    background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
    color: white !important;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
}

.facebook-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.3);
    background: linear-gradient(135deg, #166fe5 0%, #3b96e8 100%);
}

.tour-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    align-self: flex-start;
}

/* About Us Section */
.about-us-section {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin: 1rem auto; /* Reduced from 2rem */
    padding: 1rem; /* Reduced from 2rem */
    max-width: 1200px;
}

.about-us-section:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.about-us-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 1rem; /* Reduced from 2rem */
    gap: 0.5rem; /* Reduced from 1.5rem */
}

.about-us-image {
    width: 100%;
    height: 330px; /* Fixed height as requested */
    object-fit: cover;
    object-position: center; /* Center the image for cropping */
    border-radius: 15px;
    flex-shrink: 0;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
    margin-top: 0.3rem; /* new */
}

.about-us-content {
    flex: 1;
    padding: 0 0.5rem; /* Reduced from 1rem */
}

.about-us-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

.about-us-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem; /* Reduced from 1.5rem */
}

.about-us-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0.5rem 0; /* Reduced from 1.5rem */
}

.about-us-content p {
    color: #666;
    line-height: 1.4; /* Reduced from 1.6 */
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

.about-us-content ul {
    list-style-type: disc;
    margin-left: 1.5rem; /* Reduced from 2rem */
    color: #666;
    margin-bottom: 0.5rem; /* Reduced from 1rem */
}

.about-us-content ul li {
    margin-bottom: 0.3rem; /* Reduced from 0.5rem */
}

/* Two-Column Layout for About Us */
.about-us-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem; /* Reduced from 2rem */
    margin-bottom: 1rem; /* Reduced from 2rem */
}

@media (max-width: 768px) {
    .about-us-columns {
        grid-template-columns: 1fr;
    }
    .about-us-item {
        flex-direction: column;
    }
    .about-us-image {
        width: 100%;
        margin: 0 0 0.5rem 0;
    }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ecf0f1;
    font-size: 1.2rem;
}

.footer-section p, .footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: #667eea;
    transition: color 0.3s ease;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 680px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Tour Form */
#tour-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#tour-form input,
#tour-form textarea,
#tour-form select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#tour-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Action Buttons */
.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.add-btn {
    background: linear-gradient(135deg, #28a745 0%, #38c172 100%);
}

.add-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #2e9b57 100%);
}

.update-btn {
    background: linear-gradient(135deg, #007bff 0%, #4599ff 100%);
}

.update-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #3b87e8 100%);
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #d63e4d 100%);
}

.cancel-btn {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #747b82 100%);
}

.tour-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .main-content {
        margin: -30px auto 2rem;
        padding: 2rem 1rem;
    }

    .tours-list .tour-item {
        flex-direction: column;
    }

    .tours-list .tour-image {
        width: 100%;
        height: 200px;
    }

    .tours-cards {
        grid-template-columns: 1fr;
    }

    .view-toggle {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    nav ul {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .about-us-item {
        flex-direction: column;
    }

    .about-us-image {
        width: 100%;
        margin: 0 0 0.5rem 0;
    }

    .about-us-columns {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Hidden class */
.hidden {
    display: none !important;
}

/* Image Manager */
.image-grid-container {
    margin: 1rem 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #ccc;
}

.image-item {
    position: relative;
    cursor: pointer;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    display: block;
}

.image-item:hover .thumbnail {
    opacity: 0.8;
}

.image-item.selected .thumbnail {
    border: 2px solid #007bff;
}

.image-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4444;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-delete-btn:hover {
    background: #cc0000;
}

.image-item.selected .thumbnail {
    border: 2px solid #28a745; /* Зеленая рамка */
}

.content-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 1200px;
}

.edit-content-btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    display: block;
    width: fit-content;
}

.edit-content-btn:hover {
    background: #0056b3;
}

.page-content {
    line-height: 1.6;
}

.footer-logo {
    max-width: 260px;
    height: auto;
    margin-bottom: 0.0rem;
}