@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  position: relative;
}

body {
  height: 100%;
  width: 100%;
  background-color: #f3f3f3;
  font-family: "Inter", sans-serif;
  font-size: 15px;
}

header {
  display: flex;
  justify-content: space-around;
  height: 80px;
  padding-top: 20px;
}

header > .__imageCont {
  width: 50px;
}

.__imageCont > img {
  width: 100%;
}

nav ul > li {
  display: inline-block;
  padding: 0px 20px;
  list-style-type: none;
}

nav ul > li a[href] {
  text-decoration: none;
}

nav ul > li a[href]:hover {
  color: hsl(5, 85%, 63%);
}

header > img[src*="icon-menu"] {
  display: none;
}

/* main section */

main {
  display: grid;
  grid-template-areas:
    "desktop__image desktop__image aside"
    "Left__Article Right__Article aside";
  gap: 1.5rem;
  place-content: center;
  width: 900px;
  margin-inline: auto;
}

main > aside {
  background-color: hsl(240, 100%, 5%);
}

main > section {
  grid-area: desktop__image;
}

section > img {
  width: 100%;
}

.imagebg {
  background-image: url(./assets/images/image-web-3-desktop.jpg);
  background-size: cover;
  background-position: center;
  height: 250px;
}

article:has(h1) {
  grid-area: Left__Article;
  font-size: 2rem;
  width: 300px;
}

article:has(p) {
  grid-area: Right__Article;
  line-height: 25px;
}

button {
  padding: 10px 30px;
  background-color: hsl(5, 85%, 63%);
  color: #f3f3f3;
  border: none;
  margin-top: 30px;
  cursor: pointer;
}

button:hover {
  background-color: hsl(240, 100%, 5%);
}

aside:has(.__box_content) {
  grid-area: aside;
}

.__box_content {
  padding: 1rem 1.5rem;
}

div.border {
  border: 1px solid hsl(236, 13%, 42%);
  margin-top: 20px;
}

.__box_content > h4 {
  color: white;
  font-size: 18px;
}

.__box_content > h4:hover {
  color: hsl(35, 77%, 62%);
  cursor: pointer;
}

.__box_content > h6 {
  color: hsl(233, 16%, 89%);
  font-size: 12px;
  margin-top: 8px;
}

.__box_content > h6:hover {
  color: hsl(35, 74%, 72%);
  cursor: pointer;
}


.__box_content > p {
  color: hsl(236, 13%, 42%);
  padding-top: 10px;
  line-height: 25px;
}

aside > h2 {
  color: hsl(35, 77%, 62%);
  padding-top: 10px;
  font-size: 30px;
  padding-left: 1.5rem;
}



/* Last section before footer */
section:has(.__box) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 60px;
  gap: 1.5rem;
  margin-bottom: 60px;
  width: 900px;
  margin-inline: auto;
}

section > .__box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: 1.5rem;
}

div.__box > img {
  width: 100%;
}

.content__img {
  height: 100%;
}

div.content__img > h2 {
  color: hsl(233, 8%, 79%);
}

div.content__img > h6 {
  color: hsl(233, 16%, 89%);
}

div.content__img > h4 {
  padding: 20px 0px;
}

div.content__img > h4:hover {
  color: hsl(5, 85%, 63%);
  cursor: pointer;
}

div.content__img > p {
  line-height: 20px;
  color: hsl(233, 8%, 79%);
}













@media (max-width: 912px) {
  main {
    width: 800px;
  }

  section:has(.__box) {
    width: 800px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  main {
    grid-template-areas:
      "desktop__image"
      "Left__Article"
      "Right__Article"
      "aside";
    width: 300px;
  }

  .imagebg {
    background-image: url("./assets/images/image-web-3-mobile.jpg");
  }

  .__box:has([src="./assets/images/outside.jpg"]) {
    grid-column-start: 1;
    grid-row-start: 1;
    grid-row-end: 2;
    grid-column-end: 4;
  }

  .__box:has([src="./assets/images/image-top-laptops.jpg"]) {
    grid-column-start: 1;
    grid-row-start: 2;
    grid-row-end: 3;
    grid-column-end: 4;
  }
  .__box:has([src="./assets/images/image-gaming-growth.jpg"]) {
    grid-column-start: 1;
    grid-row-start: 3;
    grid-row-end: 4;
    grid-column-end: 4;
  }

  section:has(.__box) {
    width: 300px;
  }

  header > img[src="./assets/images/icon-menu.svg"] {
    display: block;
    width: 50px;
    height: 35px;
  }

  header > img[src="./assets/images/icon-menu-close.svg"] {
    width: 40px;
    height: 40px;
  }

  nav > ul {
    position: fixed;
    height: 100vh;
    background-color: #2f3640;
    top: 60px;
    right: -100%;
    transition: all 1s ease-out;
  }

  nav ul > li {
    margin: 50px 0px;
    line-height: 30px;
    display: block;
  }

  nav > ul.show {
    right: -30%;
    height: 100%;
    width: 100%;
  }

  ul > li a {
    font-size: 20px;
    color: #f3f3f3;
  }
}

/* Contact Page */
.contact-main {
  display: block;
  width: 900px;
  margin-inline: auto;
  padding: 2rem 0;
}

.contact-container {
  max-width: 600px;
}

.contact-container h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: hsl(240, 100%, 5%);
}

.contact-intro {
  line-height: 25px;
  color: hsl(236, 13%, 42%);
  margin-bottom: 2rem;
}

.contact-container form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-weight: 700;
  font-size: 14px;
  color: hsl(240, 100%, 5%);
}

.form-group input,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid hsl(233, 16%, 89%);
  border-radius: 4px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: hsl(5, 85%, 63%);
}

.form-group textarea {
  resize: vertical;
}

.success-message {
  text-align: center;
  padding-top: 4rem;
  max-width: 600px;
  margin-inline: auto;
}

.success-message a {
  text-decoration: none;
}

@media (max-width: 912px) {
  .contact-main {
    width: 800px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .contact-main {
    width: 300px;
  }
}

/* Chat Widget */
#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: "Inter", sans-serif;
}

#chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: hsl(5, 85%, 63%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s;
}

#chat-toggle:hover {
  background-color: hsl(5, 85%, 53%);
}

#chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-height: 480px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat-panel.chat-hidden {
  display: none;
}

#chat-header {
  background-color: hsl(240, 100%, 5%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}

#chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

#chat-close:hover {
  color: hsl(5, 85%, 63%);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  min-height: 200px;
}

.chat-message p {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}

.assistant-message p {
  background-color: #f0f0f0;
  color: hsl(240, 100%, 5%);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.user-message {
  display: flex;
  justify-content: flex-end;
}

.user-message p {
  background-color: hsl(5, 85%, 63%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

#chat-form {
  display: flex;
  border-top: 1px solid #e0e0e0;
  padding: 10px;
  gap: 8px;
  align-items: center;
}

#chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: hsl(5, 85%, 63%);
}

#chat-send {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background-color: hsl(5, 85%, 63%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

#chat-send:hover {
  background-color: hsl(5, 85%, 53%);
}

#chat-send:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.chat-typing p {
  background-color: #f0f0f0;
  color: hsl(236, 13%, 42%);
  font-style: italic;
}

@keyframes chatSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chat-panel.chat-entrance {
  animation: chatSlideIn 0.4s ease-out;
}

@media (max-width: 900px) and (orientation: portrait) {
  #chat-panel {
    width: calc(100vw - 48px);
    right: 0;
  }
}