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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

header {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 1rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

nav ul li a i {
    margin-right: 0.5rem;
}

nav ul li a:hover {
    color: #ddd;
}

nav ul li a.active {
    border-bottom: 2px solid #fff;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

main {
    margin-top: 80px;
}

section {
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://via.placeholder.com/1920x1080.png?text=Кам'янець-Подільський+замок');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    position: relative;
}

#history-hero {
    height: 50vh;
    background-image: url('https://via.placeholder.com/1920x1080.png?text=Історія+замку');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

#history-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#history-hero .hero-content {
    z-index: 1;
}

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #333;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    right: -20px;
    background-color: #333;
    border: 4px solid #fff;
    border-radius: 50%;
    top: 15px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -20px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: #f9f9f9;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    margin-top: 0;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.legend-item {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-5px);
}

.fact-list {
    list-style-type: none;
    padding-left: 0;
}

.fact-list li {
    margin-bottom: 1rem;
    padding-left: 30px;
    position: relative;
}

.fact-list li::before {
    content: '\f0eb';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #333;
}

@media (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-icon {
        left: 10px;
        right: auto;
    }

    .timeline-item:nth-child(even) .timeline-icon {
        left: 10px;
    }
}
.hero-content {
    z-index: 1;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

#hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.5s;
    animation-fill-mode: both;
}

#gallery-hero {
    height: 50vh;
    background-image: url('https://via.placeholder.com/1920x1080.png?text=Фотоальбом');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

#gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#gallery-hero .hero-content {
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#location-hero {
    height: 50vh;
    background-image: url('https://via.placeholder.com/1920x1080.png?text=Розташування');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

#location-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#location-hero .hero-content {
    z-index: 1;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.location-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-container {
    width: 100%;
    height: 450px;
}

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

.direction-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.direction-item:hover {
    transform: translateY(-5px);
}

.direction-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

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

.nearby-item {
    text-align: center;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.nearby-item:hover {
    transform: translateY(-5px);
}

.nearby-item img {
    width: 100%;
    height: auto;
    display: block;
}

.nearby-item h3 {
    margin-top: 1rem;
}

#tours-hero {
    height: 50vh;
    background-image: url('https://via.placeholder.com/1920x1080.png?text=Екскурсії+та+ціни');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

#tours-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#tours-hero .hero-content {
    z-index: 1;
}

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

.tour-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tour-item:hover {
    transform: translateY(-5px);
}

.tour-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.price-table th, .price-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

.booking-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

@media (max-width: 768px) {
    .location-grid,
    .directions-grid,
    .nearby-grid,
    .tour-grid {
        grid-template-columns: 1fr;
    }

    .booking-form {
        padding: 1rem;
    }
}

.cta-button {
    display: inline-block;
    background-color: #fff;
    color: #333;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: fadeInUp 1s ease-out 1s;
    animation-fill-mode: both;
}

.cta-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px);
}

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

.info-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.about-image {
    flex: 1;
    max-width: 400px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 2;
}

.image-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
}

.gallery-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay-content {
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    padding: 1rem;
}

.view-more {
    display: block;
    text-align: center;
    margin-top: 2rem;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.view-more:hover {
    color: #666;
}

footer {
    background-color: #333;
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-section {
    flex: 1;
    margin-bottom: 2rem;
    min-width: 200px;
}

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

.footer-section p, .footer-section ul {
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ddd;
}

.social-icon {
    font-size: 1.5rem;
    color: #fff;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: #ddd;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #555;
}

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

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

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.9);
        padding: 1rem 0;
    }

    nav ul.show {
        display: flex;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .menu-toggle {
        display: block;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        max-width: 100%;
    }

    .footer-content {
        flex-direction: column;
    }
}

html {
    scroll-behavior: smooth;
}