/* ============================================= */
/*                 BASE VARIABLES               */
/* ============================================= */
:root {
  --primary: #6e48aa;
  --secondary: #9d50bb;
  --accent: #4776e6;
  --dark: #0f0f1a;
  --light: #f0f0ff;
  --neon: #00f7ff;
  --user-bubble: #4776e6;
  --assistant-bubble: #6e48aa;
}

/* ============================================= */
/*                  BASE STYLES                 */
/* ============================================= */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--dark);
  color: var(--light);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(110, 72, 170, 0.15) 0%, transparent 25%),
    radial-gradient(circle at 80% 70%, rgba(71, 118, 230, 0.15) 0%, transparent 25%);
  padding-bottom: env(safe-area-inset-bottom);

}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.logo {
  position: fixed;
  top: 20px;
  z-index: 10;
}

.left-logo {
  left: 80px;
}

.right-logo {
  right: 20px;
}

.logo img {
  height: 180px;
  filter: drop-shadow(0 0 10px var(--neon));
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-top: 20px;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin: 0;
  background: linear-gradient(270deg, 
    #00f7ff, 
    #6a00ff, 
    #ff00e6,
    #00f7ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: 
    gradientFlow 3.5s linear infinite,
    textFlicker 4s infinite alternate;
  text-shadow: 
    0 0 8px rgba(0, 247, 255, 0.7),
    0 0 16px rgba(106, 0, 255, 0.5),
    0 0 24px rgba(255, 0, 230, 0.3);
  letter-spacing: 4px;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1.1;
}

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

@keyframes textFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    text-shadow: 
      0 0 8px rgba(0, 247, 255, 0.7),
      0 0 16px rgba(106, 0, 255, 0.5),
      0 0 24px rgba(255, 0, 230, 0.3);
  }
  20%, 24%, 55% {
    opacity: 0.8;
    text-shadow: 
      0 0 4px rgba(0, 247, 255, 0.4),
      0 0 8px rgba(106, 0, 255, 0.3);
  }
}

/* Optional minimal hover effect */
h1:hover {
  animation: 
    gradientFlow 1.5s linear infinite,
    textFlicker 2s infinite alternate;
}

header p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-top: 5px;
  color: var(--light);
  opacity: 0.8;
}

.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.mode-toggle button {
  background: rgba(15, 15, 26, 0.7);
  border: 1px solid var(--primary);
  color: var(--light);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.mode-toggle button:hover {
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
  transform: translateY(-2px);
}

.chat-container {
  background: rgba(15, 15, 26, 0.7);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(110, 72, 170, 0.3);
}

.chat-history {
  height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 15px;
  background: rgba(20, 20, 35, 0.5);
  border: 1px solid rgba(110, 72, 170, 0.2);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-area {
  display: flex;
  gap: 10px;
}

textarea {
  flex: 1;
  padding: 12px 15px;
  border-radius: 10px;
  border: none;
  background: rgba(30, 30, 50, 0.8);
  color: var(--light);
  resize: none;
  font-family: 'Roboto', sans-serif;
  border: 1px solid rgba(110, 72, 170, 0.3);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(71, 118, 230, 0.5);
}

button {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(110, 72, 170, 0.5);
}

.message {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 18px;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.user-message {
  align-self: flex-end;
  background-color: var(--user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: 30%;
}

.assistant-message {
  align-self: flex-start;
  background-color: var(--assistant-bubble);
  color: white;
  border-bottom-left-radius: 4px;
  margin-right: 30%;
}

.message-content {
  word-wrap: break-word;
  line-height: 1.4;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  .logo img {
    height: 120px;
  }
  .chat-container {
    padding: 15px;
  }
  .input-area {
  flex-direction: column; /* ✅ Stack textarea & button vertikal */
  gap: 8px; /* ✅ Tambahkan sedikit jarak */
}
textarea,
button {
  width: 100%; /* ✅ Full width supaya tidak terpotong */
  font-size: 16px; /* ✅ Hindari zoom iOS Safari */
}
}

/* ============================================= */
/*                  MASCOT                      */
/* ============================================= */
.mascot {
  position: fixed; /* biar selalu di layar */
  top: 30px;
  right: 50px;
  z-index: 1000;
  cursor: grab; /* icon tangan saat hover */
}

.mascot:active {
  cursor: grabbing;
}


.mascot-image {
    width: 150px; /* ✅ Ukuran lebih pas di header */
    height: 150px;
    background-image: url('assets/DELIA.png');
    background-size: cover;
    border-radius: 50%;
    border: 3px solid var(--neon);
    box-shadow: 0 0 20px var(--neon);
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.mascot-bubble {
    position: absolute;
    top: 50%;
    left: -250px; /* ✅ Bubble ke samping kiri maskot */
    transform: translateY(-50%);
    background: rgba(15, 15, 26, 0.9);
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid var(--neon);
    box-shadow: 0 5px 15px rgba(0, 247, 255, 0.3);
    width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mascot:hover .mascot-bubble {
    opacity: 1;
    transform: translateY(-50%) translateX(-10px); /* ✅ Bubble animasi keluar halus */
}





/* ============================================= */
/*               RESPONSIVE STYLES              */
/* ============================================= */
@media (max-width: 768px) {
  .logo {
    display: none;
  }
  .container {
    padding: 10px;
  }
  h1 {
    font-size: 2.5rem;
  }
  .mode-toggle button {
    font-size: 14px;
    padding: 8px 12px;
  }
  
  .mascot-image {
    width: 70px;
    height: 70px;
  }
  .mascot-bubble {
    width: 140px;
    font-size: 12px;
  }
  .input-area {
    flex-direction: column;
  }
  textarea {
    width: 100%;
    font-size: 14px;
  }
  button {
    width: 100%;
    margin-top: 5px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 5px;
  }
  .chat-container {
    padding: 10px;
  }
  .mode-toggle button {
    font-size: 12px;
    padding: 6px 10px;
  }
  textarea {
    font-size: 13px;
  }
  .mascot-image {
    width: 60px;
    height: 60px;
  }
  .mascot-bubble {
    width: 120px;
    font-size: 11px;
  }
}

:root {
  --primary: #6e48aa;
  --secondary: #9d50bb;
  --accent: #4776e6;
  --dark: #0f0f1a;
  --light: #f0f0ff;
  --neon: #00f7ff;
  --user-bubble: #4776e6;
  --assistant-bubble: #6e48aa;
}

/* ... (keep all previous styles until .chat-history) ... */

.chat-history {
  height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 15px;
  background: rgba(20, 20, 35, 0.5);
  border: 1px solid rgba(110, 72, 170, 0.2);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 18px;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.user-message {
  align-self: flex-end;
  background-color: var(--user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: 30%;
}

.assistant-message {
  align-self: flex-start;
  background-color: var(--assistant-bubble);
  color: white;
  border-bottom-left-radius: 4px;
  margin-right: 30%;
}

.message-content {
  word-wrap: break-word;
  line-height: 1.4;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.assistant-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Animation for new messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ... (keep all other existing styles) ... */

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  background-color: var(--assistant-bubble);
  padding: 10px 15px;
  border-radius: 18px;
  display: inline-flex;
  border-bottom-left-radius: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  margin: 0 2px;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

.prompt-suggestions {
  margin-top: 10px;
  text-align: center;
}
.prompt-suggestions button {
  margin: 5px;
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  background: #e6f0ff;
  border: 1px solid #8aaae5;
  cursor: pointer;
}

/* Right-aligned Mascot */
.right-mascot {
  right: 20px;
  left: auto;
}


/* Card Styles */
.info-card, .dosen-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-left: 5px solid #3498db;
}

/* Header Styles */
.info-card h3, .dosen-header h3 {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2em;
  display: flex;
  align-items: center;
}

.info-card h3 i, .dosen-header i {
  margin-right: 12px;
  color: #3498db;
}

/* Grid Layout for Program Info */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px 20px;
}

.info-label {
  font-weight: 600;
  color: #7f8c8d;
  display: flex;
  align-items: center;
}

.info-value {
  color: #34495e;
  line-height: 1.5;
}

/* Lecturer Card Details */
.dosen-details {
  padding-left: 32px;
}

.detail-label {
  font-weight: 600;
  color: #7f8c8d;
  display: inline-flex;
  align-items: center;
  min-width: 100px;
  margin-right: 8px;
}

.detail-label i {
  margin-right: 8px;
  width: 16px;
  color: #3498db;
}

/* Links */
a {
  color: #2980b9;
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  color: #1a5276;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .info-label {
    margin-top: 10px;
  }
  
  .dosen-card, .info-card {
    padding: 15px;
  }
  
  .detail-label {
    min-width: 80px;
  }
}

/* Animation */
.dosen-card:hover, .info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}
/* Typing indicator styles */
.typing-indicator {
  opacity: 0.8;
}

.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #666;
  margin: 0 2px;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}
@media (max-width: 1024px) {
  .logo {
    display: none !important; /* ✅ Sembunyikan logo di iPad & tablet besar */
  }
}

@media (max-width: 991px) {
  .logo {
    display: none !important; /* ✅ Sembunyikan logo di tablet sedang */
  }
}

@media (max-width: 800px) {
  .logo {
    display: none !important; /* ✅ Sembunyikan logo di Kindle Fire & device kecil */
  }
}
