/* ===============================
   GLOBAL RESET
================================= */

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Poppins',sans-serif;
}

/* ===============================
   BODY
================================= */

body{

  background:linear-gradient(
    135deg,
    #0f172a,
    #111827,
    #1e293b
  );

  background-size:400% 400%;

  animation:gradientMove 15s ease infinite;

  color:white;

  min-height:100vh;

  overflow-x:hidden;
}

/* ===============================
   BACKGROUND ANIMATION
================================= */

@keyframes gradientMove{

  0%{
    background-position:0% 50%;
  }

  50%{
    background-position:100% 50%;
  }

  100%{
    background-position:0% 50%;
  }
}

/* ===============================
   OVERLAY
================================= */

.overlay{

  position:fixed;

  inset:0;

  background:rgba(0,0,0,0.45);

  z-index:-1;
}

/* ===============================
   LOGIN PAGE
================================= */

.login-container{

  display:flex;

  justify-content:center;

  align-items:center;

  min-height:100vh;

  padding:20px;
}

/* ===============================
   GLASS CARD
================================= */

.glass-card{

  background:rgba(255,255,255,0.06);

  border:1px solid rgba(255,255,255,0.12);

  backdrop-filter:blur(14px);

  border-radius:24px;

  padding:40px;

  box-shadow:0 8px 32px rgba(0,0,0,0.3);

  animation:fadeUp 0.5s ease;
}

.login-container .glass-card{

  width:100%;

  max-width:430px;
}

/* ===============================
   FADE ANIMATION
================================= */

@keyframes fadeUp{

  from{

    opacity:0;

    transform:translateY(20px);
  }

  to{

    opacity:1;

    transform:translateY(0);
  }
}

/* ===============================
   HEADINGS
================================= */

h1{

  text-align:center;

  font-size:2.5rem;

  margin-bottom:10px;
}

.subtitle{

  text-align:center;

  color:#cfcfcf;

  margin-bottom:30px;
}

/* ===============================
   INPUTS
================================= */

input{

  width:100%;

  padding:15px;

  border:none;

  outline:none;

  border-radius:14px;

  background:rgba(255,255,255,0.1);

  color:white;

  font-size:15px;

  margin-bottom:18px;

  transition:0.3s ease;
}

input:focus{

  border:1px solid #7f5af0;

  box-shadow:0 0 15px rgba(127,90,240,0.3);
}

input::placeholder{

  color:#cfcfcf;
}

/* ===============================
   BUTTONS
================================= */

button{

  width:100%;

  padding:14px;

  border:none;

  border-radius:14px;

  cursor:pointer;

  font-size:15px;

  font-weight:600;

  color:white;

  background:linear-gradient(
    135deg,
    #7f5af0,
    #2cb67d
  );

  transition:0.3s ease;
}

button:hover{

  transform:translateY(-2px);

  box-shadow:0 0 20px rgba(127,90,240,0.45);
}

/* ===============================
   ERROR MESSAGE
================================= */

#error-msg{

  margin-top:15px;

  color:#ff6b6b;

  text-align:center;
}

/* ===============================
   MAIN CONTAINER
================================= */

.main-container{

  width:90%;

  max-width:1200px;

  margin:auto;

  padding:40px 0 80px;
}

/* ===============================
   TOP BAR
================================= */

.top-bar{

  display:flex;

  justify-content:space-between;

  align-items:center;

  gap:20px;

  margin-bottom:40px;
}

/* ===============================
   USER PROFILE
================================= */

.top-right{

  display:flex;

  align-items:center;

  gap:15px;
}

.user-profile{

  display:flex;

  align-items:center;

  gap:12px;

  background:rgba(255,255,255,0.06);

  padding:10px 16px;

  border-radius:16px;

  border:1px solid rgba(255,255,255,0.08);
}

.avatar{

  width:45px;

  height:45px;

  border-radius:50%;

  display:flex;

  justify-content:center;

  align-items:center;

  background:linear-gradient(
    135deg,
    #7f5af0,
    #2cb67d
  );

  font-size:20px;

  font-weight:700;
}

.welcome-text{

  font-size:15px;

  font-weight:600;
}

/* ===============================
   THEME BUTTON
================================= */

.theme-btn{

  width:55px;

  height:55px;

  border-radius:50%;

  display:flex;

  justify-content:center;

  align-items:center;

  font-size:22px;

  background:rgba(255,255,255,0.08);
}

/* ===============================
   LOGOUT BUTTON
================================= */

.logout-btn{

  width:auto;

  padding:12px 22px;
}

/* ===============================
   MODE SELECT
================================= */

.mode-select{

  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: center;

}

.mode-select label{

  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;

}
/* ===============================
   LANGUAGE SELECT
================================= */

.language-select{

  display:flex;

  gap:15px;

  margin-bottom:25px;
}

.lang-btn{

  width:auto;

  padding:10px 22px;

  background:#222;
}

.active-lang{

  background:linear-gradient(
    135deg,
    #7f5af0,
    #2cb67d
  );
}

/* ===============================
   GENERATOR
================================= */

.generator-box{

  margin-bottom:30px;
}

.generator-box h2{

  margin-bottom:20px;
}

/* ===============================
   VOICE BUTTON
================================= */

.voice-btn{

  margin-top:15px;

  background:linear-gradient(
    135deg,
    #ff4d6d,
    #7f5af0
  );
}

/* ===============================
   OUTPUT SECTION
================================= */

.output-section{

  display:grid;

  gap:20px;
}

.output-card{

  background:rgba(255,255,255,0.06);

  border:1px solid rgba(255,255,255,0.12);

  border-radius:20px;

  padding:25px;
}

/* ===============================
   OUTPUT ACTIONS
================================= */

.top-actions{

  display:flex;

  justify-content:space-between;

  align-items:center;

  gap:15px;

  margin-bottom:20px;
}

.copy-btn{

  width:auto;

  padding:10px 18px;
}

/* ===============================
   PRE TEXT
================================= */

pre{

  white-space:pre-wrap;

  line-height:1.8;

  font-size:15px;
}

/* ===============================
   SPINNER
================================= */

.loading-card{

  text-align:center;
}

.spinner{

  width:60px;

  height:60px;

  margin:20px auto;

  border:6px solid rgba(255,255,255,0.15);

  border-top:6px solid #7f5af0;

  border-radius:50%;

  animation:spin 1s linear infinite;
}

@keyframes spin{

  100%{
    transform:rotate(360deg);
  }
}

/* ===============================
   HISTORY
================================= */

.history-search{

  margin:20px 0;
}

.history-item{

  display:flex;

  justify-content:space-between;

  align-items:center;

  gap:20px;

  background:rgba(255,255,255,0.05);

  padding:20px;

  border-radius:18px;

  margin-top:15px;

  border:1px solid rgba(255,255,255,0.08);
}

.history-title{

  display:flex;

  align-items:center;

  gap:12px;
}

.history-buttons{

  display:flex;

  gap:10px;
}

/* ===============================
   FAVORITE BUTTON
================================= */

.favorite-btn{

  width:45px;

  height:45px;

  border-radius:12px;

  background:#252525;

  color:gold;

  font-size:20px;
}

.favorite-note{

  border:1px solid gold;

  box-shadow:0 0 20px rgba(255,215,0,0.15);
}

/* ===============================
   TOAST
================================= */

#toast{

  position:fixed;

  top:30px;

  right:30px;

  background:#111;

  color:white;

  padding:16px 25px;

  border-radius:14px;

  font-size:15px;

  font-weight:600;

  opacity:0;

  visibility:hidden;

  transform:translateY(-20px);

  transition:0.4s ease;

  z-index:9999;
}

#toast.show{

  opacity:1;

  visibility:visible;

  transform:translateY(0);
}

/* ===============================
   LIGHT MODE
================================= */

.light-mode{

  background:#f4f7ff;

  color:#111;
}

.light-mode .glass-card,
.light-mode .output-card,
.light-mode .history-item{

  background:rgba(255,255,255,0.9);

  color:black;

  border:1px solid rgba(0,0,0,0.08);
}

.light-mode input{

  background:#ececec;

  color:black;
}

.light-mode input::placeholder{

  color:#666;
}

.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode p,
.light-mode label{

  color:black;
}

.light-mode .theme-btn{

  background:rgba(0,0,0,0.08);

  color:black;
}

/* ===============================
   SCROLLBAR
================================= */

::-webkit-scrollbar{

  width:10px;
}

::-webkit-scrollbar-thumb{

  background:linear-gradient(
    #7f5af0,
    #2cb67d
  );

  border-radius:20px;
}

/* ===============================
   RESPONSIVE
================================= */

@media(max-width:768px){

  .top-bar{

    flex-direction:column;
  }

  .top-right{

    flex-direction:column;
  }

  .top-actions{

    flex-direction:column;

    align-items:flex-start;
  }

  .history-item{

    flex-direction:column;

    align-items:flex-start;
  }

  h1{

    font-size:2rem;
  }

  .glass-card{

    padding:25px;
  }
}

.self-chat-container{

  display:flex;
  flex-direction:column;
  gap:18px;
  margin-top:30px;
  padding-bottom:30px;

}

.user-chat{

  background:linear-gradient(
    135deg,
    #7f5af0,
    #2cb67d
  );

  color:white;

  padding:16px 20px;

  border-radius:18px 18px 4px 18px;

  align-self:flex-end;

  max-width:420px;

  width:fit-content;

  font-size:15px;

  line-height:1.7;

  box-shadow:0 4px 15px rgba(0,0,0,0.25);

}

.ai-chat{

  background:#1c1f2b;

  color:white;

  padding:16px 20px;

  border-radius:18px 18px 18px 4px;

  align-self:flex-start;

  max-width:700px;

  width:fit-content;

  font-size:15px;

  line-height:1.8;

  border:1px solid rgba(255,255,255,0.08);

  box-shadow:0 4px 15px rgba(0,0,0,0.25);

}