/* Finihive Stylesheet - Glassmorphic Theme */

:root {
  --primary-color: #5d3fd3; /* Iris / Purple */
  --primary-light: #8a2be2;
  --secondary-color: #ff6b6b;
  --accent-color: #00f2fe;
  
  --bg-dark: #0f111a;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(0, 0, 0, 0.25);
  --glass-glow: rgba(93, 63, 211, 0.15);
  
  --font-family: 'Poppins', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background animated decorative blobs */
.background-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s infinite alternate;
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 80%);
  top: -10%;
  left: -10%;
}

.circle-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--secondary-color) 0%, transparent 80%);
  bottom: -15%;
  right: -10%;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(80px, 50px) scale(1.2);
  }
}

/* App Container */
.app-container {
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 32px var(--glass-shadow);
  overflow: hidden;
}

/* Header */
.app-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-icon {
  font-size: 26px;
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo h1 span {
  color: var(--accent-color);
}

.status-bar {
  display: flex;
  gap: 12px;
}

.model-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--text-muted);
}

.model-select-wrapper .select-icon {
  margin-right: 6px;
  color: var(--accent-color);
}

.model-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  padding: 6px 0;
  padding-right: 15px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.model-select-wrapper::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-size: 8px;
  color: var(--text-muted);
}

.status-badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.status-badge.active {
  color: #10b981; /* Green */
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.error {
  color: #ef4444; /* Red */
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Main Body Layout */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Chat Section */
.chat-section {
  flex: 1.2;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chat-header h2 {
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls {
  display: flex;
  gap: 8px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-muted);
}

.control-btn.active {
  background: rgba(93, 63, 211, 0.2);
  border-color: var(--primary-color);
  color: var(--accent-color);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  align-self: flex-start;
  animation: fadeIn 0.4s ease;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 10px var(--glass-glow);
}

.message.user .avatar {
  background: var(--secondary-color);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}

.message-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  border-top-left-radius: 0;
}

.message.user .message-content {
  background: rgba(93, 63, 211, 0.15);
  border-color: rgba(93, 63, 211, 0.25);
  border-radius: 16px;
  border-top-right-radius: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Voice Speech Controls */
.speech-controls {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}

.mic-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(93, 63, 211, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(93, 63, 211, 0.6);
}

.mic-btn:active {
  transform: scale(0.95);
}

.mic-btn.listening {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #ff8787 100%);
  box-shadow: 0 0 25px rgba(255, 107, 107, 0.6);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.interim-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  min-height: 20px;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Audio wave bars */
.speech-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.speech-wave.active {
  opacity: 1;
}

.speech-wave span {
  width: 3px;
  height: 5px;
  background-color: var(--secondary-color);
  border-radius: 2px;
  animation: bounce 1s infinite alternate;
}

.speech-wave span:nth-child(2) { animation-delay: 0.15s; }
.speech-wave span:nth-child(3) { animation-delay: 0.3s; }
.speech-wave span:nth-child(4) { animation-delay: 0.45s; }
.speech-wave span:nth-child(5) { animation-delay: 0.6s; }

@keyframes bounce {
  from { height: 5px; }
  to { height: 20px; }
}

/* Chat Form */
.chat-form {
  display: flex;
  gap: 10px;
}

.chat-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 12px 18px;
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-form input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(93, 63, 211, 0.2);
}

.chat-form button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 45px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.chat-form button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Dashboard Section */
.dashboard-section {
  flex: 0.8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(0, 0, 0, 0.05);
  overflow-y: auto;
}

.weather-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.weather-card:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.main-card {
  flex: 1.3;
  justify-content: center;
  position: relative;
  min-height: 220px;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 50px;
  color: var(--primary-color);
  opacity: 0.6;
}

.gps-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.gps-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.hidden {
  display: none !important;
}

.location-info h3 {
  font-size: 20px;
  font-weight: 600;
}

.location-info p {
  font-size: 13px;
  color: var(--accent-color);
  margin-top: 2px;
}

.temp-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.weather-emoji {
  font-size: 56px;
}

.temperature {
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  display: flex;
}

.temperature .unit {
  font-size: 24px;
  font-weight: 400;
  margin-top: 6px;
}

.weather-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 15px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-item i {
  font-size: 18px;
  color: var(--accent-color);
  width: 24px;
  text-align: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 13px;
  font-weight: 500;
}

/* Forecast Card Layout */
.forecast-card {
  flex: 1;
}

.forecast-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.forecast-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--text-muted);
  font-size: 12px;
}

.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forecast-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 13px;
}

.forecast-day {
  font-weight: 500;
  width: 80px;
}

.forecast-cond {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forecast-emoji {
  font-size: 18px;
}

.forecast-temp {
  font-weight: 600;
  text-align: right;
}

.forecast-temp span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* Footer styling */
.app-footer {
  padding: 12px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 850px) {
  body {
    padding: 10px 0;
  }
  
  .app-container {
    width: 95%;
    height: 95vh;
    border-radius: 16px;
  }

  .app-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .chat-section {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    flex: none;
    height: 55%;
  }

  .dashboard-section {
    flex: none;
    height: 45%;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 20px;
  }
  
  .status-bar {
    display: none; /* Hide status tags on small mobile screens to save space */
  }

  .weather-stats {
    grid-template-columns: 1fr;
  }
}
