    .history-item { border-left: 4px solid #6366f1; padding-left: 15px; align-items: center; justify-content: flex-start; }

    .modal-overlay {
      display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center;
    }

    .modal-card {padding: 2rem; border-radius: 12px; max-width: 400px; width: 90%; position: relative; }

    .dark .modal-card { background: #1f1f1f; color: #eee; }

    .tab-btn { padding: 8px 16px; cursor: pointer; border: none; border-radius: 4px; margin-right: 5px; }

    .tab-btn.active { background: #6366f1}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter',system-ui, sans-serif; }

html { font-size: 19px; scroll-behavior: smooth; zoom: 0.67; /* For Chrome, Safari, and Edge */
  -moz-transform: scale(0.67); /* For Firefox */
  -moz-transform-origin: 0 0; }

body {
  margin: 0;
  min-height: 100vh;
  background-attachment: fixed;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

body::before, body::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.2;
}

body::before { background: #6366f1; top: -10%; left: -5%; }
body::after { background: #a855f7; bottom: -10%; right: -5%; }
@keyframes move { from { transform: translate(0,0) scale(1); } to { transform: translate(100px, 100px) scale(1.2); } }

.container {
  max-width: 5000px;
  min-height: 800px;
  width: 90%;
  margin: 100px auto;
  padding: 0 50px;
  gap: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.3s ease, border-color 0.3s ease;
  align-items: stretch;
  justify-content: space-between;
  box-sizing: border-box;
}
textarea, 
.suggested-rewrite,
#historyList {
  width: 100%;
  box-sizing: border-box;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

@media (min-width: 768px) {
  .container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 800px;
    margin: 100px auto;
    padding: 0 50px;
  }

  .card {
    padding: 50px;
    margin-bottom: 0;
  }
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-10px);
}

textarea {
  width: 100%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff8fa;
  border-radius: 16px;
  padding: 30px;
  margin: 50px auto;
  font-size: 1.4rem;
  text-align: left;
  min-height: 350px;
  display: block;
}
textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }

.analysis-heading { 
  color: #f8fafc; text-transform: uppercase; letter-spacing: 2px; 
  font-size: 0.9rem; font-weight: 800; margin-top: 25px;
}

.analysis-text { font-size: 1.2rem; color: #94a3b8; }

.suggested-rewrite-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 14px;
  color: #fff;
}

.say-it-back-btn {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border: none; font-weight: 700; padding: 20px 40px;
  font-size: 1.1rem; border-radius: 18px; cursor: pointer;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
  position: relative; overflow: hidden; transition: transform 0.2s ease;
}

.say-it-back-btn::after {
  content: ""; position: absolute; top: -50%; left: -60%; width: 50px; height: 200%;
  background: rgba(255, 255, 255, 0.2); transform: rotate(35deg); transition: all 0.6s ease;
}
.say-it-back-btn:hover::after { left: 120%; }
.say-it-back-btn:active { transform: scale(0.95); }

.emoji-bar span { font-size: 28px; cursor: pointer; transition: transform 0.2s; }
.emoji-bar span:hover { transform: scale(1.3); }

.e1 { top: 15%; left: 10%; animation-duration: 25s; }
.e2 { top: 60%; left: 85%; animation-duration: 30s; }
.e3 { top: 80%; left: 20%; animation-duration: 22s; }
.e4 { top: 10%; left: 70%; animation-duration: 28s; }

@keyframes float-around {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(50px, 100px) rotate(20deg); }
}

@media (max-width: 768px) {
  .emoji-bar {
    display: none;
  }
}

.header {
  width: 100%;
  min-height: 100px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.8rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  font-size: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px; 
}

.theme-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
  border-color: #6366f1;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.emoji-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.emoji-bar span {
  font-size: 1.5rem;
  margin: 0 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.emoji-bar span:hover {
  transform: scale(1.4);
}

.actions button{
  margin-left: 10px;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.analysis-header {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.emoji-icon:hover {
  transform: scale(1.2) translateY(-5px);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  margin-left: 170px;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

#historyList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 400px;
}

.history-item{
  width: 100%;
  box-sizing: border-box;
}

#analyzeBtn2{
  width:100px;
  height: 50px;
  font-size: 1rem;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
#analyzeBtn2:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

#loginBtn{
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
#loginBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 📱 Mobile Styles (Screens smaller than 600px) */
@media screen and (max-width: 600px) {
  
  /* Make the main layout container take up full width with small breathing room */
  .container {
    width: 95% !important;
    padding: 10px !important;
    margin: 0 auto !important;
  }

  /* Stack history & analysis cards vertically instead of side-by-side */
  .card {
    padding: 1.5rem !important;
    border-radius: 12px !important;
  }

  /* Make sure floating emojis don't cover the screen or text */
  .floating-emoji {
    display: none; /* Best practice for mobile to keep UI clean! */
  }

  /* Center headings on mobile */
  h2 {
    font-size: 1.5rem !important;
    text-align: center;
    margin-left: 0 !important; /* Fixes your history margin from index.html */
  }

  /* Make input fields and textareas massive and easy to tap */
  textarea {
    font-size: 16px !important; /* Prevents iOS from auto-zooming in! */
  }
}
