/* Base styles and typography */
:root {
    --primary-color: #00cfff;
    --primary-dark: #0088ff;
    --accent-color: #7fdbff;
    --background-dark: #1a2633;
    --background-light: #ffffff;
    --text-dark: #063954;
    --text-light: #e0e0e0;
    --shadow-color: rgba(0, 207, 255, 0.2);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(180deg, #1a4c6b 0%, #063954 100%);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

h1, h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Sticky Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--shadow-color);
}

.site-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

button.theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px;
  font-size: 20px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 2000;
  transition: background 0.2s;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-speed);
}

.theme-toggle:hover {
    background: var(--shadow-color);
    transform: scale(1.1);
}

/* Style for the bot interface */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.bot-container {
    text-align: center;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
h1 {
    text-align: center;
    font-size: 36px;
    margin-top: 20px;
}


button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #0088ff;
    transform: scale(1.05);
    transition: 0.2s;
}

#botResponse {
    margin-top: 20px;
    font-size: 18px;
    color: #555;
}

/* Style for the Copilot-style chatbot interface with aquarium theme */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(180deg, #1a4c6b 0%, #063954 100%);
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.chat-list {
    width: 18vw;
    min-width: 150px;
    max-width: 300px;
    background-color: rgba(14, 42, 71, 0.9);
    color: white;
    padding: 10px;
    overflow-y: auto;
    font-size: 1.1vw;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#chatList {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 10px;
}

#newChat{
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.chat-list h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #7fdbff;
    text-shadow: 0 0 10px rgba(127, 219, 255, 0.3);
    font-size: 1.3vw;
}

.chat-item {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(127, 219, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item.active {
    background: linear-gradient(90deg, #00cfff 0%, #7fdbff 100%);
    color: #063954;
    border: 2px solid #00cfff;
    box-shadow: 0 0 10px 2px #00cfff33;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.chat-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-chat-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0 5px;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0;
}

.chat-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    color: #ff4d4d;
    transform: scale(1.2);
}

.chat-container {
    flex-grow: 1;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 248, 255, 0.95) 100%);
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: none;
    padding: 0;
    position: relative;
    backdrop-filter: blur(10px);
    min-width: 0;
    min-height: 0;
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    margin: 0;
    height: 100%;
    min-height: 0;
}

.chat-message {
    margin: 8px 0;
    padding: 12px;
    border-radius: 15px;
    max-width: 70%;
    font-size: 16px;
    display: flex;
    position: relative;
    animation: float 1s ease-out;
}

@keyframes float {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.user-message {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: auto;
    margin-right: 0;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.bot-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: var(--text-dark);
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(6, 57, 84, 0.1);
    border: 1px solid var(--shadow-color);
    margin-right: auto;
    margin-left: 0;
    justify-content: flex-start;
}

.suggestion-bubbles {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    justify-content: center;
    background: transparent;
}

.suggestion-bubble {
    background: rgba(127, 219, 255, 0.1);
    border: 2px solid rgba(127, 219, 255, 0.3);
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #063954;
    position: relative;
    animation: bobbing 3s ease-in-out infinite;
}

@keyframes bobbing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.suggestion-bubble:hover {
    background: rgba(127, 219, 255, 0.2);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 5px 15px rgba(127, 219, 255, 0.2);
}

.input-container {
    display: flex;
    gap: 1vw;
    padding: 2vw;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(127, 219, 255, 0.3);
    position: relative;
    backdrop-filter: blur(5px);
    margin-top: 0;
    box-sizing: border-box;
    width: 100%;
}

input {
    flex: 10;
    padding: 2vw 1vw;
    border: 2px solid rgba(127, 219, 255, 0.3);
    border-radius: 10px;
    font-size: 1.2vw;
    background: rgba(255, 255, 255, 0.9);
    color: #063954;
    transition: all 0.3s ease;
    min-width: 0;
}

button, #speakButton {
    background: linear-gradient(135deg, #4dc4ff 0%, #7fdbff 100%);
    color: #063954;
    border: none;
    padding: 1.2vw 2vw;
    min-width: 2.5vw;
    font-size: 1.2vw;
    border-radius: 1vw;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);
}

button:hover, #speakButton:hover {
    background: linear-gradient(135deg, #00cfff 0%, #4dc4ff 100%);
    color: #063954;
    transform: scale(1.05);
    transition: 0.2s;
}

.user-message {
    background: linear-gradient(135deg, #00bfff 0%, #4dc4ff 100%);
    color: white;
    margin-left: auto;
    margin-right: 0;
    justify-content: flex-end;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.2);
}

.chat-list h2 {
    color: #00cfff;
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.3);
}

.suggestion-bubble {
    border: 2px solid rgba(0, 207, 255, 0.3);
    color: #063954;
}

.suggestion-bubble:hover {
    background: rgba(0, 207, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 207, 255, 0.2);
}

input:focus {
    border-color: #00cfff;
    box-shadow: 0 0 10px rgba(0, 207, 255, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 207, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 207, 255, 0.5);
}

/* Responsive images: ensures images scale on all devices */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Example: Hide elements on small screens (add .hide-on-mobile to any element you want hidden) */
@media (max-width: 600px) {
    .hide-on-mobile {
        display: none !important;
    }
}

body.phone-mode .app-container {
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    min-width: 0;
    min-height: 0;
}

body.phone-mode .chat-list {
    width: 100vw;
    min-width: 0;
    max-width: none;
    height: 18vh;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 3.5vw;
    box-sizing: border-box;
}

body.phone-mode .chat-list h2 {
    font-size: 4vw;
    margin-bottom: 10px;
}

body.phone-mode #chatList {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    margin-bottom: 0;
}

body.phone-mode .chat-item {
    min-width: 120px;
    max-width: 200px;
    font-size: 3vw;
    margin-right: 8px;
    margin-bottom: 0;
}

body.phone-mode .chat-container {
    height: calc(100dvh - 18vh);
    min-height: 0;
    width: 100vw;
    max-width: none;
    padding: 0;
}

body.phone-mode .chat-window {
    padding: 2vw;
    font-size: 3vw;
}

body.phone-mode .input-container {
    flex-direction: column;
    gap: 2vw;
    padding: 3vw 2vw;
    width: 100vw;
}

body.phone-mode input, body.phone-mode button, body.phone-mode #speakButton {
    font-size: 4vw;
    padding: 3vw 2vw;
}

body.phone-mode #speakButton {
    font-size: 5vw;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(127, 219, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(127, 219, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 219, 255, 0.5);
}

body.dark-mode {
    background: linear-gradient(180deg, #101820 0%, #1a2633 100%);
    color: #e0e0e0;
}

body.dark-mode .app-container {
    background: none;
}

body.dark-mode .chat-list {
    background-color: rgba(20, 30, 50, 0.95);
    color: #b0eaff;
    border-right: 1px solid rgba(127, 219, 255, 0.2);
}

body.dark-mode .chat-list h2 {
    color: #4dc4ff;
    text-shadow: 0 0 10px rgba(77, 196, 255, 0.3);
}

body.dark-mode .chat-item {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(77, 196, 255, 0.1);
    color: #b0eaff;
}

body.dark-mode .chat-item.active {
    background: rgba(77, 196, 255, 0.1);
}

body.dark-mode .chat-container {
    background: linear-gradient(160deg, #232b38 0%, #1a2633 100%);
    color: #e0e0e0;
}

body.dark-mode .chat-window {
    background: transparent;
}

body.dark-mode .user-message {
    background: linear-gradient(135deg, #0056b3 0%, #003366 100%);
    color: #e0e0e0;
}

body.dark-mode .bot-message {
    background: linear-gradient(135deg, #232b38 0%, #2e3a4d 100%);
    color: #b0eaff;
}

body.dark-mode .suggestion-bubble {
    background: rgba(77, 196, 255, 0.08);
    border: 2px solid rgba(77, 196, 255, 0.2);
    color: #b0eaff;
}

body.dark-mode .suggestion-bubble:hover {
    background: rgba(77, 196, 255, 0.18);
}

body.dark-mode .input-container {
    background: rgba(30, 40, 60, 0.95);
    border-top: 1px solid rgba(77, 196, 255, 0.2);
}

body.dark-mode input {
    background: rgba(30, 40, 60, 0.95);
    color: #e0e0e0;
    border: 2px solid rgba(77, 196, 255, 0.2);
}

body.dark-mode input:focus {
    border-color: #4dc4ff;
    box-shadow: 0 0 10px rgba(77, 196, 255, 0.2);
}

body.dark-mode button, body.dark-mode #speakButton {
    background: linear-gradient(135deg, #232b38 0%, #4dc4ff 100%);
    color: #e0e0e0;
}

body.dark-mode button:hover, body.dark-mode #speakButton:hover {
    background: linear-gradient(135deg, #4dc4ff 0%, #232b38 100%);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(77, 196, 255, 0.3);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(77, 196, 255, 0.08);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  80% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes slideInLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes buttonPulse {
  0%, 100% { box-shadow: 0 0 0 0 #00cfff44; }
  50% { box-shadow: 0 0 10px 4px #00cfff88; }
}

@keyframes hoverPop {
  0% { transform: scale(1); box-shadow: none; }
  60% { transform: scale(1.08); box-shadow: 0 4px 20px 0 #00cfff44; }
  100% { transform: scale(1.05); box-shadow: 0 2px 10px 0 #00cfff33; }
}

@keyframes hoverGlow {
  0% { box-shadow: none; }
  100% { box-shadow: 0 0 12px 2px #00cfff66; }
}

.app-container {
  animation: fadeIn 0.8s ease;
}

.chat-list {
  animation: slideInLeft 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}

.chat-container {
  animation: slideInRight 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}

.chat-item {
  animation: fadeIn 0.5s;
  transition: background 0.3s, color 0.3s, border 0.3s, box-shadow 0.3s;
}

.chat-item.active {
  animation: popIn 0.4s;
}

.chat-message {
  animation: float 1s ease-out, fadeIn 0.5s;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.suggestion-bubble {
  animation: bobbing 3s ease-in-out infinite, fadeIn 0.7s;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.input-container {
  animation: fadeIn 0.7s;
}

button, #speakButton {
  animation: buttonPulse 2.5s infinite;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.2s;
}

button:hover, #speakButton:hover {
  animation: hoverPop 0.3s forwards;
}

.chat-item:hover {
  animation: hoverGlow 0.3s forwards;
  background: linear-gradient(90deg, #7fdbff 0%, #b3f0ff 100%);
  color: #063954;
  border: 2px solid #00cfff;
  z-index: 2;
}

.suggestion-bubble:hover {
  animation: hoverPop 0.3s forwards, bobbing 3s ease-in-out infinite;
}

input:focus {
  animation: hoverGlow 0.3s forwards;
}

button:active, #speakButton:active {
  transform: scale(0.97);
}

input {
  transition: border 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
}

::-webkit-scrollbar-thumb {
  transition: background 0.3s;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    margin: 10px 0;
    animation: fadeIn 0.5s;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

body.dark-mode {
  background-color: #121212;
  color: #ffffff;
}

body {
  transition: background-color 0.3s, color 0.3s;
}


#newChat {
    padding: 1.2vw 2vw;
    font-size: 1.2vw;
    border-radius: 1vw;
    box-shadow: 0 2px 8px #00cfff33;
    background: linear-gradient(135deg, #00cfff 0%, #7fdbff 100%);
    color: #063954;
    font-weight: bold;
    border: none;
    transition: background 0.2s, transform 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    outline: none;
    position: relative;
    z-index: 3001;
}

#newChat:hover {
    background: linear-gradient(135deg, #7fdbff 0%, #00cfff 100%);
    transform: scale(1.07);
    box-shadow: 0 4px 16px #00cfff55;
}

body.dark-mode #newChat {
    background: linear-gradient(135deg, #232b38 0%, #4dc4ff 100%);
    color: #e0e0e0;
    border-radius: 1vw;
    font-weight: bold;
    box-shadow: 0 2px 12px #4dc4ff33;
    border: none;
    padding: 1.2vw 2vw;
    font-size: 1.2vw;
    text-shadow: 0 1px 2px rgba(255,255,255,0.2);
    transition: all 0.3s;
}
#howmachnemes {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;

  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px #00cfff33;
  background: linear-gradient(135deg, #00cfff 0%, #7fdbff 100%);
  color: #063954;
  transition: all 0.3s ease;
}

#howmachnemes:hover {
  background: linear-gradient(135deg, #7fdbff 0%, #00cfff 100%);
  transform: scale(1.07);
  box-shadow: 0 4px 16px #00cfff55;
}

body.dark-mode #howmachnemes {
  background: linear-gradient(135deg, #232b38 0%, #4dc4ff 100%);
  color: #e0e0e0;
  box-shadow: 0 2px 12px #4dc4ff33;
}

body.dark-mode #howmachnemes:hover {
  background: linear-gradient(135deg, #4dc4ff 0%, #232b38 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px #4dc4ff55;
  transform: scale(1.05);
}


body.dark-mode #newChat:hover {
    background: linear-gradient(135deg, #4dc4ff 0%, #232b38 100%);
    color: #fff;
    box-shadow: 0 4px 20px #4dc4ff55;
    transform: scale(1.05);
}
