/* ===================================
    Booki - Hotel Booking Platform
    Main Stylesheet
   =================================== */

/* =========================
    External Dependencies
   ========================= */
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;700&display=swap");

/* =========================
    Design System & Variables
   ========================= */
:root {
  /* Color Palette */
  --color-primary: #0065fc;
  --color-primary-light: #deebff;
  --color-background: #f2f2f2;
  --color-white: #ffffff;
  --color-text: #000000;
  --color-border: #d9d9d9;
  --color-star-filled: var(--color-primary);
  --color-star-empty: var(--color-background);

  /* Typography */
  --font-family-primary: "Raleway", sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Font Sizes */
  --font-size-xs: 0.5em;
  --font-size-sm: 0.875em;
  --font-size-base: 1em;
  --font-size-lg: 1.25em;
  --font-size-xl: 1.5em;

  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-3xl: 3rem;

  /* Layout */
  --container-max-width: 1500px;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --z-index-base: 1;

  /* Width */
  --width-full: 100%;
  --width-half: 50%;
  --height-full: 100%;
}

/* =========================
    CSS Reset & Base Styles
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family-primary);
  color: var(--color-text);
  line-height: 1.6;
}

/* =========================
    Body
   ========================= */
body {
  max-width: var(--container-max-width);
  margin: 0 auto;
  background-color: var(--color-white);
}

/* =========================
    Typography & Text Elements
   ========================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

h1 {
  font-size: var(--font-size-lg);
}

h2 {
  font-size: var(--font-size-lg);
}

h3 {
  font-size: var(--font-size-base);
}

/* =========================
    Interactive Elements
   ========================= */
a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: var(--color-primary);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

button:focus,
input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* =========================
    Form Elements
   ========================= */

input,
textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

input::placeholder,
textarea::placeholder {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

/* =========================
    Lists & Images
   ========================= */
ul,
ol {
  list-style: none;
}

img {
  max-width: var(--width-full);
  height: auto;
  object-fit: cover;
  display: block;
}

/* =========================
    Layout Components
   ========================= */

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 0 var(--space-xl);
}

.header__logo {
  margin: var(--space-lg) 0;
}

.header__nav,
.header__nav-list {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.header__nav-item {
  display: flex;
  justify-content: center;
  position: relative;
}

.header__nav-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: var(--width-full);
  padding: var(--space-lg);
  font-weight: var(--font-weight-medium);
}

.header__nav-link:hover::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--width-full);
  height: 0.2rem;
  line-height: 1.3rem;
  background-color: var(--color-primary);
}

/* Main Content */
main {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  gap: var(--space-lg);
}

.main__title {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.main__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

/* =========================
    Search Component
   ========================= */
.search {
  display: flex;
  align-items: stretch;
  height: var(--space-3xl);
  margin: var(--space-md) 0;
  overflow: hidden;
}

.search__label {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: var(--space-3xl);
  background-color: var(--color-background);
  color: var(--color-text);
}

.search__input {
  flex: 1;
  max-width: 13rem;
  padding: 0 var(--space-md);
  font-size: var(--font-size-base);
}

.search__input:focus {
  outline: none;
  border: 0.2rem solid var(--color-primary);
}

.search__input:focus::placeholder {
  color: transparent;
}

.search__button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  border-radius: 0 1rem 1rem 0;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: var(--font-weight-bold);
}

.search__button:hover {
  background-color: #0056d6;
}

.search__button-text {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
}

.search__button i {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
}

/* =========================
    Filters Component
   ========================= */
.filters {
  display: grid;
  gap: var(--space-lg);
}

.filters__container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.filters__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.filters__lists {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
}

.filters__button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  max-height: 50px;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--space-3xl);
  background: var(--color-white);
  font-weight: var(--font-weight-bold);
}

.filters__button:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.filters__button i {
  color: var(--color-primary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

.filters__info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-text);
}

.filters__info i {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

/* =========================
    Hotels Section
   ========================= */
.hotels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-3xl);
}

.hotels__offers,
.hotels__popular {
  display: flex;
  flex-direction: column;
  border-radius: var(--space-md);
  padding: var(--space-xl);
  background-color: var(--color-background);
}

.hotels__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.hotels__title i {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
}

.hotels__more {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-top: auto;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

.hotels__more a {
  position: absolute;
  z-index: var(--z-index-base);
}

/* =========================
    Cards Component
   ========================= */
.cards__offers,
.cards__popular {
  display: grid;
  gap: var(--space-xl);
}

.cards__offers {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  position: relative;
  height: var(--height-full);
  border-radius: var(--space-lg);
  box-shadow: var(--shadow-sm);
  background: var(--color-white);
  overflow: hidden;
}

.card a {
  position: absolute;
  width: var(--width-full);
  height: var(--height-full);
  z-index: var(--z-index-base);
}

.card__popular {
  flex-direction: row;
}

.card__image {
  width: var(--width-full);
  height: 180px;
  border-radius: var(--space-lg) var(--space-lg) 0 0;
  border: var(--space-xs) solid var(--color-white);
}

.card__popular-image {
  width: 130px;
  border-radius: var(--space-lg) 0 0 var(--space-lg);
}

.card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-md);
}

.card__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.card__price {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-md);
}

.card__rating {
  display: flex;
  gap: 2px;
  margin-top: auto;
}

.card__star {
  color: var(--color-star-filled);
  font-size: var(--font-size-sm);
}

.card__star--empty {
  color: var(--color-star-empty);
}

/* =========================
    Activities Section
   ========================= */
.main__activities,
.activities,
.cards__activities {
  display: grid;
  gap: var(--space-xl);
}

.cards__activities {
  grid-template-columns: repeat(4, 1fr);
}

.activities__content-title {
  display: flex;
  align-items: center;
  padding-left: var(--space-md);
  height: 60px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.card__image-activities {
  width: var(--width-full);
  height: 400px;
  border-radius: var(--space-lg) var(--space-lg) 0 0;
}

/* =========================
    Footer
   ========================= */
footer {
  display: grid;
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background-color: var(--color-background);
}

.footer__column,
.footer__nav,
.footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__nav {
  flex-direction: row;
  justify-content: space-between;
}

.footer__bottom {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* =========================
    Responsive Design
   ========================= */

/* Tablet Layout (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
  /* =========================
    Filters Component
   ========================= */
  .filters__container {
    flex-direction: column;
    align-items: flex-start;
  }

  /* =========================
    Hotels Section
   ========================= */
  .hotels {
    grid-template-columns: 1fr;
  }

  .hotels__offers,
  .hotels__popular {
    padding: var(--space-lg);
    gap: var(--space-lg);
    width: var(--width-full);
  }

  .hotels__title i {
    font-size: var(--font-size-lg);
  }

  /* =========================
    Cards Component
   ========================= */
  .cards__popular {
    grid-template-columns: repeat(3, 1fr);
  }

  .card__popular-image {
    height: var(--height-full);
    width: 100px;
  }

  .card__content {
    padding: 0.8rem;
  }

  .card__title {
    font-size: 1rem;
    line-height: 1.2;
    white-space: normal;
  }

  /* =========================
    Activities Section
   ========================= */
  .activities {
    padding: var(--space-lg);
  }

  .card__image-activities {
    height: 200px;
  }
}

/* =========================
    Responsive Design
   ========================= */
/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
  /* =========================
    Header & Navigation
   ========================= */
  header {
    flex-direction: column;
    align-items: center;
    padding: 0;
  }

  .header__logo {
    margin: var(--space-xl) 0 var(--space-md);
  }

  .header__nav,
  .header__nav-list {
    width: var(--width-full);
  }

  .header__nav-item {
    width: var(--width-half);
  }

  .header__nav-link {
    align-items: center;
    justify-content: center;
    border-bottom: 0.2rem solid var(--color-background);
  }

  .header__nav-link:hover {
    border-bottom: 0.2rem solid var(--color-primary);
  }

  .header__nav-link:hover::after {
    display: none;
  }

  /* =========================
    Search & Filters
   ========================= */
  .search {
    width: var(--width-full);
    padding: 0 var(--space-lg);
  }

  .search__input {
    max-width: var(--width-full);
  }

  .search__button {
    min-width: var(--space-3xl);
    width: var(--space-3xl);
  }

  .search__button-text {
    display: none;
  }

  .search__button i {
    display: inline;
    font-size: var(--font-size-lg);
  }

  .filters__container {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters__lists {
    grid-template-columns: repeat(2, 1fr);
    width: var(--width-full);
  }

  /* =========================
    Hotels Section
   ========================= */
  .hotels {
    grid-template-columns: 1fr;
  }

  .hotels__offers,
  .hotels__popular {
    width: var(--width-full);
    padding: var(--space-md);
  }

  .hotels__popular {
    order: 1;
  }

  .hotels__offers {
    order: 2;
  }

  /* =========================
    Cards Layout
   ========================= */
  .cards__offers {
    grid-template-columns: 1fr;
  }

  .cards__popular {
    flex-direction: column;
  }

  /* =========================
    Activities Section
   ========================= */
  .cards__activities {
    grid-template-columns: 1fr;
  }

  .card__activities-image {
    height: 75%;
  }

  /* =========================
    Footer
   ========================= */
  .footer__nav {
    flex-direction: column;
    gap: var(--space-3xl);
  }
}
