:root {
    --primary-color: #2842c8;
    --secondary-color: #fff;
    --text-color: #000;
    --background-color: #f8f8f8;
    --hover-color: #1a2e8a;
    --dark-mode-background: #1a1a1a;
    --dark-mode-text: #f0f0f0;
    --dark-mode-header: #4a6cd4;
    --dark-mode-aside: #333;
    --dark-mode-hover: #3a5bc4;
    --dark-mode-border: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-color: #2842c8;
    --scrollbar-track-color: #f8f8f8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--secondary-color);
    overflow-x: hidden;
    display: flex;
}

button a {
    text-decoration: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 100%;
    height: 50px;
    background: var(--secondary-color);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    border-top: 1px solid var(--dark-mode-border);
}

.sidebar-header {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-color);
    order: 1;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    list-style: none;
}

.sidebar-content li {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.sidebar-content li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    width: 100%;
    text-align: center;
    padding: 10px 5px;
    transition: color 0.3s;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Featured Houses */
.featured-houses {
    padding: 30px 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    border-radius: 0.5rem;
}

.featured-houses h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: var(--primary-color);
}

.houses-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.houses-container::-webkit-scrollbar {
    display: none;
}

.house-box {
    flex: 0 0 80%;
    background-color: var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    scroll-snap-align: start;
    transition: transform 0.3s ease;
}

.house-box:hover {
    transform: translateY(-5px);
}

.house-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.house-box h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.house-box p {
    font-size: 14px;
    margin-bottom: 15px;
}

.location {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-bottom: 15px;
}

.location-icon {
    margin-right: 5px;
}

.price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Animations */
@keyframes slideDownStop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        transform: translateY(35vh);
        opacity: 1;
    }
    100% {
        transform: translateY(35vh);
        opacity: 1;
    }
}

.icon-animation {
    position: fixed;
    top: 0;
    left: 45%;
    transform: translateX(-50%);
    animation: slideDownStop 5s ease-in-out forwards;
    font-size: 40px;
}

/* Index Page */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: url("../assets/img/croacia--39.jpg") no-repeat center center / cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.content {
    position: relative;
    z-index: 1;
    color: var(--secondary-color);
}

.content h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.enter-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 18px;
    transition: background 0.3s;
    margin-top: 20px;
}

.enter-button:hover {
    background: var(--hover-color);
}

/* Reservations */
.search-button-toggle {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
}

.gradient-item {
    background: var(--primary-color);
}

.gradient-item a {
    color: var(--secondary-color) !important;
}

main {
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
}

.search-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    z-index: 100;
}

.search-form {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 15px;
}

.search-group {
    width: 100%;
    border: none;
    padding: 0;
    margin: 0;
}

.search-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    border-radius: 4px;
}

.search-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    height: 45px;
}

.search-button:hover {
    background: var(--hover-color);
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-content p {
    font-size: 18px;
    opacity: 0.9;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    background-color: var(--background-color);
}

.category {
    text-align: center;
    flex: 1 1 30%;
    margin-bottom: 10px;
}

.category a {
    text-decoration: none;
    color: var(--text-color);
}

.category i {
    font-size: 30px;
    margin-bottom: 5px;
}

.category p {
    font-size: 12px;
    margin: 0;
}

/* Tablet Styles */
@media screen and (min-width: 768px) {
    .hero-content h1 {
        font-size: 48px;
    }

    .hero-content p {
        font-size: 20px;
    }

    .search-group {
        flex: 1 1 calc(50% - 10px);
    }

    .search-form {
        flex-direction: row;
        flex-wrap: wrap;
        display: flex;
    }

    .search-group {
        flex: 1 1 calc(50% - 10px);
    }

    .search-button {
        width: auto;
        min-width: 200px;
    }

    .search-button-toggle {
        display: none;
    }

    .house-box {
        flex: 0 0 calc(50% - 20px);
    }

    .content h1 {
        font-size: 64px;
    }

    .enter-button {
        font-size: 20px;
        padding: 14px 28px;
    }

    /* Categories */
    .category {
        flex: 1 1 10%;
    }

    .category i {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .category p {
        font-size: 14px;
    }
}

/* Desktop Styles */
@media screen and (min-width: 1024px) {
    .sidebar {
        width: 60px;
        height: 100vh;
        right: 0;
        top: 0;
        bottom: auto;
        left: auto;
        flex-direction: column;
        border-top: none;
        border-left: 1px solid var(--dark-mode-border);
    }

    .sidebar-header {
        width: 100%;
        height: 60px;
        order: 0;
    }

    .sidebar-content {
        flex-direction: column;
        height: calc(100% - 60px);
    }

    .sidebar-content li a {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-size: 14px;
        padding: 20px 0;
    }

    main {
        margin-right: 60px;
        width: calc(100% - 60px);
        padding-bottom: 0;
    }

    .video-container {
        right: 60px;
        width: calc(100% - 60px);
    }

    .search-container {
        padding: 20px;
    }

    .search-form {
        max-width: 1200px;
        margin: 0 auto;
        flex-wrap: nowrap;
    }

    .search-group {
        flex: 1;
    }

    .search-button {
        align-self: end;
        height: 45px;
    }

    .search-group input,
    .search-group select {
        height: 45px;
    }

    .hero-content h1 {
        font-size: 72px;
        margin-bottom: 20px;
    }

    .hero-content p {
        font-size: 24px;
    }

    .houses-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: scroll;
        gap: 20px;
        padding-bottom: 20px;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
    }

    .house-box {
        flex: 0 0 400px;
        scroll-snap-align: start;
    }

    .content h1 {
        font-size: 100px;
    }

    .content h2 {
        font-size: 48px;
        margin-bottom: 1rem;
    }

    .enter-button {
        font-size: 22px;
        padding: 16px 32px;
        margin-top: 0;
    }

    @keyframes slideDownStop {
        0% {
            transform: translateY(-100%);
            opacity: 0;
        }
        50% {
            transform: translateY(25vh);
            opacity: 1;
        }
        100% {
            transform: translateY(25vh);
            opacity: 1;
        }
    }

    .icon-animation {
        position: fixed;
        top: 0;
        left: 47%;
        transform: translateX(-50%);
        animation: slideDownStop 5s ease-in-out forwards;
        font-size: 100px;
    }

    /* Categories */
    .category {
        flex: 1 1 15%;
    }

    .category i {
        font-size: 50px;
        margin-bottom: 10px;
    }

    .category p {
        font-size: 16px;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: var(--dark-mode-background);
    color: var(--dark-mode-text);
}

.dark-mode .featured-houses {
    background-color: var(--dark-mode-aside);
    color: var(--dark-mode-text);
}

.dark-mode .featured-houses h2 {
    color: var(--dark-mode-header);
}

.dark-mode .house-box {
    background-color: var(--dark-mode-aside);
    box-shadow: 0 4px 6px var(--dark-mode-border);
}

.dark-mode .house-box h3 {
    color: var(--dark-mode-text);
}

.dark-mode .price {
    color: var(--dark-mode-header);
}

.dark-mode .search-button,
.dark-mode .search-button-toggle {
    background: var(--dark-mode-header);
    color: var(--dark-mode-text);
}

.dark-mode .search-button:hover,
.dark-mode .search-button-toggle:hover {
    background: var(--dark-mode-hover);
}

.dark-mode .search-group input,
.dark-mode .search-group select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-mode-text);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .sidebar {
    background: var(--dark-mode-aside);
    border-color: var(--dark-mode-border);
}

.dark-mode .sidebar-content li a {
    color: var(--dark-mode-text);
}

.dark-mode .gradient-item {
    background: var(--dark-mode-header);
}