/* ================================
   GEMINI DUYGU ANALIZ CHATBOT
   Modern & Responsive CSS
   ================================ */

:root {
  /* Light Theme Colors */
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --bot-bg: #e0f2fe;
  --user-bg: #dcfce7;
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Dark Theme */
body.dark {
  --bg-color: #0f172a;
  --text-color: #f1f5f9;
  --bot-bg: #1e293b;
  --user-bg: #164e63;
  --border-color: #334155;
}

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

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-color) 0%, #e2e8f0 100%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  transition: all 0.3s ease;
}

body.dark {
  background: linear-gradient(135deg, var(--bg-color) 0%, #1e293b 100%);
}

/* Container */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Header */
.header {
  position: relative;
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

body.dark .header {
  background: rgba(30, 41, 59, 0.9);
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Logo Styles */
.logo-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: var(--shadow-medium);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: logoFloat 4s ease-in-out infinite;
  z-index: 2;
  position: relative;
  will-change: transform;
}

.logo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 20px;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: var(--shadow-medium);
  animation: logoFloat 4s ease-in-out infinite;
  z-index: 2;
  position: relative;
  will-change: transform;
}

.logo-image:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: var(--shadow-heavy);
  cursor: pointer;
}

.logo-fallback:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: var(--shadow-heavy);
  cursor: pointer;
}

/* Logo zoom on click */
.logo-container.zoomed .logo-image {
  transform: scale(1.3);
  transition: transform 0.3s ease;
}

.logo-container.zoomed .logo-fallback {
  transform: scale(1.3);
  transition: transform 0.3s ease;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(139, 92, 246, 0.2) 50%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: logoGlow 3s ease-in-out infinite alternate;
  z-index: 1;
  will-change: transform, opacity;
}

@keyframes logoFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  25% { 
    transform: translateY(-8px) rotate(1deg); 
  }
  50% { 
    transform: translateY(-5px) rotate(0deg); 
  }
  75% { 
    transform: translateY(-12px) rotate(-1deg); 
  }
}

@keyframes logoGlow {
  0% { 
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  100% { 
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Logo pulse on hover */
.logo-container:hover .logo-glow {
  animation: logoPulse 0.6s ease-in-out;
}

@keyframes logoPulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
  100% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Logo thinking animation when AI is processing */
.logo-container.thinking .logo-image {
  animation: logoThinking 1s ease-in-out infinite;
}

.logo-container.thinking .logo-fallback {
  animation: logoThinking 1s ease-in-out infinite;
}

.logo-container.thinking .logo-glow {
  animation: logoThinkingGlow 1.5s ease-in-out infinite;
}

@keyframes logoThinking {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-2deg) scale(1.05); }
  75% { transform: rotate(2deg) scale(1.05); }
}

@keyframes logoThinkingGlow {
  0%, 100% { 
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(139, 92, 246, 0.2) 50%, transparent 70%);
    transform: translate(-50%, -50%) scale(1);
  }
  50% { 
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(245, 158, 11, 0.3) 50%, transparent 70%);
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 1rem;
}

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
}

body.dark .controls {
  background: rgba(30, 41, 59, 0.9);
}

.control-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.control-btn.deep-analysis {
  background: var(--secondary-color);
  color: white;
}

.control-btn.deep-analysis:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

.control-btn.clear-history {
  background: var(--danger-color);
  color: white;
}

.control-btn.clear-history:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* Chat Container */
.chat-container {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 25px;
}

body.dark .chat-container {
  background: rgba(30, 41, 59, 0.95);
}

/* Messages */
.messages {
  height: 450px;
  overflow-y: auto;
  padding: 25px;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 6px;
}

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

.messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.message {
  margin: 15px 0;
  padding: 16px 20px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  animation: messageSlide 0.4s ease;
  box-shadow: var(--shadow-light);
  position: relative;
}

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

.message.user {
  background: linear-gradient(135deg, var(--user-bg), #a7f3d0);
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.message.bot {
  background: linear-gradient(135deg, var(--bot-bg), #bae6fd);
  margin-right: auto;
  border-bottom-left-radius: 6px;
}

.message.temp {
  opacity: 0.7;
  animation: pulse 1.5s infinite;
}

/* Input Section */
.input-section {
  padding: 25px;
  background: rgba(248, 250, 252, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

body.dark .input-section {
  background: rgba(15, 23, 42, 0.9);
}

.input-field {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  color: var(--text-color);
  transition: all 0.3s ease;
}

body.dark .input-field {
  background: var(--bg-color);
  border-color: var(--border-color);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.action-btn {
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn.voice {
  background: var(--accent-color);
  color: white;
}

.action-btn.voice:hover {
  background: #059669;
  transform: translateY(-2px);
}

.action-btn.voice.recording {
  background: var(--danger-color);
  animation: pulse 1s infinite;
}

.action-btn.send {
  background: var(--primary-color);
  color: white;
  min-width: 100px;
}

.action-btn.send:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* Test Sentences */
.test-section {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 25px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
}

body.dark .test-section {
  background: rgba(30, 41, 59, 0.9);
}

.test-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.test-btn {
  background: linear-gradient(135deg, var(--warning-color), #fbbf24);
  color: white;
  border: none;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: var(--shadow-light);
}

.test-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    max-width: 100%;
  }
  
  .header {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .logo-container {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
  }
  
  .logo-glow {
    width: 120px;
    height: 120px;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .controls {
    flex-direction: column;
    padding: 15px;
  }
  
  .control-btn {
    min-width: auto;
    width: 100%;
  }
  
  .messages {
    height: 350px;
    padding: 15px;
  }
  
  .message {
    max-width: 90%;
    padding: 12px 16px;
  }
  
  .input-section {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }
  
  .input-field {
    width: 100%;
    padding: 14px 16px;
  }
  
  .action-btn {
    width: 100%;
    padding: 14px;
  }
  
  .test-section {
    padding: 15px;
  }
  
  .test-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .test-btn {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .messages {
    height: 300px;
  }
  
  .test-grid {
    grid-template-columns: 1fr;
  }
  
  .input-section {
    flex-direction: row;
    gap: 8px;
  }
  
  .action-btn.voice {
    min-width: 50px;
    padding: 14px 10px;
  }
  
  .action-btn.send {
    min-width: 80px;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Loading Animation */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Success/Error States */
.message.success {
  border-left: 4px solid var(--accent-color);
}

.message.error {
  border-left: 4px solid var(--danger-color);
}

/* Enhanced Focus States */
.control-btn:focus,
.action-btn:focus,
.test-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: modalFadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-color);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-heavy);
  border: 1px solid var(--border-color);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.modal-content h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.modal-content p {
  margin-bottom: 20px;
  color: var(--text-color);
  opacity: 0.8;
}

.modal-input {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 20px;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
}

.modal-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.modal-btn.primary {
  background: var(--primary-color);
  color: white;
}

.modal-btn.primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.modal-btn.secondary {
  background: var(--border-color);
  color: var(--text-color);
}

.modal-btn.secondary:hover {
  background: #cbd5e1;
  transform: translateY(-2px);
}

.modal-help {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid var(--primary-color);
}

.modal-help h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.modal-help ol {
  margin: 10px 0;
  padding-left: 20px;
}

.modal-help li {
  margin-bottom: 5px;
  color: var(--text-color);
  opacity: 0.8;
}

.modal-help a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.modal-help a:hover {
  text-decoration: underline;
}
