/* Futuristic AI Website Design */
:root {
  color-scheme: dark;
  
  /* Futuristic Color Palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-tertiary: #1a1a2e;
  --bg-glass: rgba(15, 15, 26, 0.7);
  --bg-card: rgba(26, 26, 46, 0.8);
  
  --text-primary: #ffffff;
  --text-secondary: #b8bcc8;
  --text-muted: #6b7280;
  
  --accent-primary: #00d4ff;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #f59e0b;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  
  --border-primary: rgba(0, 212, 255, 0.2);
  --border-secondary: rgba(124, 58, 237, 0.2);
  --border-glass: rgba(255, 255, 255, 0.1);
  
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --gradient-secondary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem;
  position: relative;
  z-index: 1;
}

/* Glassmorphism Cards */
.card, .groq-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 0.75rem;
  margin: 0.5rem 0;
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::before, .groq-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.6;
}

.card:hover, .groq-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1rem;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5)); }
  to { filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.5)); }
}

/* Form Elements */
label {
  display: block;
  margin: 0.75rem 0 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="email"], 
input[type="file"], 
input[type="text"], 
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-glass);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: var(--bg-tertiary);
}

/* Buttons */
button, .btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.75rem 0;
}

button::before, .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before, .btn:hover::before {
  left: 100%;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

button:active, .btn:active {
  transform: translateY(0);
}

/* Enhanced touch interactions for mobile */
@media (hover: none) and (pointer: coarse) {
  button:hover, .btn:hover {
    transform: none;
    box-shadow: none;
  }
  
  button:active, .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .card:hover, .groq-card:hover {
    transform: none;
    box-shadow: var(--shadow-glass);
  }
  
  .card:active, .groq-card:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
  }
}

/* Special Button Variants */
.btn-confirm {
  background: var(--gradient-primary);
}

.btn-validate {
  background: linear-gradient(135deg, var(--accent-tertiary) 0%, #f97316 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-danger) 0%, #dc2626 100%);
}

/* Status Indicators */
.status-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.groq-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent-success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Progress Bar */
.progress-container {
  margin: 1rem 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-container.show {
  opacity: 1;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Utility Classes */
.hint {
  opacity: 0.7;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

pre {
  overflow: auto;
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 1rem;
    max-width: 100%;
  }
  
  h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .card, .groq-card {
    padding: 1.25rem;
    margin: 1rem 0;
  }
  
  button, .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  input[type="email"], 
  input[type="file"], 
  input[type="text"], 
  textarea {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
    max-width: 100%;
  }
  
  h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
  }
  
  .card, .groq-card {
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 12px;
  }
  
  button, .btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
    width: 100%;
    margin: 0.2rem 0 !important;
    min-height: 32px !important;
    height: 32px !important;
  }
  
  input[type="email"], 
  input[type="file"], 
  input[type="text"], 
  textarea {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  label {
    font-size: 0.8rem;
    margin: 0.5rem 0 0.25rem;
  }
  
  .hint {
    font-size: 0.8rem;
    margin-top: 0.25rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .card, .groq-card {
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
  }
  
  button, .btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.65rem !important;
    margin: 0.1rem 0 !important;
    min-height: 28px !important;
    height: 28px !important;
  }
  
  input[type="email"], 
  input[type="file"], 
  input[type="text"], 
  textarea {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }
  
  label {
    font-size: 0.75rem;
    margin: 0.4rem 0 0.2rem;
  }
  
  .hint {
    font-size: 0.75rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .container {
    padding: 0.25rem;
  }
  
  h1 {
    font-size: 1.25rem;
  }
  
  .card, .groq-card {
    padding: 0.5rem;
    margin: 0.25rem 0;
  }
  
  button, .btn {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.6rem !important;
    min-height: 24px !important;
    height: 24px !important;
  }
  
  input[type="email"], 
  input[type="file"], 
  input[type="text"], 
  textarea {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Force smaller buttons on all mobile devices */
@media (max-width: 768px) and (orientation: portrait) {
  button, .btn, .example-prompt, .send-button, .header-upload-btn, .new-chat-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
    min-height: 30px !important;
    height: 30px !important;
  }
}

/* Loading Animations */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-glass);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Glow Effects */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  to { box-shadow: 0 0 30px rgba(124, 58, 237, 0.3); }
}

/* Chat Message Styling */
.chat-message {
  margin: 0.15rem 0;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  max-width: 85%;
  word-wrap: break-word;
  line-height: 1.2;
  font-size: 0.8rem;
}

.chat-message.user {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  margin-left: auto;
  text-align: right;
}

.chat-message.assistant {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  margin-right: auto;
}

/* Compact Chat Container */
.chat-container {
  max-height: 75vh;
  overflow-y: auto;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Markdown-like formatting in chat messages */
.chat-message h1,
.chat-message h2,
.chat-message h3 {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--accent-primary);
}

.chat-message h2 {
  font-size: 0.8rem;
  color: var(--accent-secondary);
}

.chat-message h3 {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-message strong {
  color: var(--accent-primary);
  font-weight: 600;
}

.chat-message ul,
.chat-message ol {
  margin: 0.2rem 0;
  padding-left: 1rem;
}

.chat-message li {
  margin: 0.1rem 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.chat-message p {
  margin: 0.2rem 0;
  color: var(--text-primary);
  font-size: 0.75rem;
}

.chat-message a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-primary);
  transition: all 0.3s ease;
}

.chat-message a:hover {
  color: var(--accent-secondary);
  border-bottom-color: var(--accent-secondary);
}

.chat-message em {
  color: var(--text-muted);
  font-style: italic;
}

/* Compact candidate cards */
.candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  padding: 0.4rem;
  margin: 0.2rem 0;
  transition: all 0.3s ease;
}

.candidate-card:hover {
  border-color: var(--border-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.candidate-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.1rem;
}

.candidate-summary {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.2rem;
}

.skill-tag {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.1rem 0.3rem;
  border-radius: 8px;
  font-size: 0.65rem;
  border: 1px solid var(--border-glass);
}

/* Compact search results */
.search-results {
  max-height: 40vh;
  overflow-y: auto;
  margin: 0.5rem 0;
}

.search-results::-webkit-scrollbar {
  width: 4px;
}

.search-results::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 2px;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 2px;
}

/* Responsive chat improvements */
@media (max-width: 1024px) {
  .chat-container {
    max-height: 70vh;
    padding: 0.5rem;
  }
  
  .chat-message {
    max-width: 90%;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
  }
  
  .candidate-card {
    padding: 0.5rem;
  }
  
  .candidate-name {
    font-size: 0.85rem;
  }
  
  .candidate-summary {
    font-size: 0.8rem;
  }
  
  .skill-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
}

@media (max-width: 768px) {
  .chat-container {
    max-height: 60vh;
    padding: 0.4rem;
  }
  
  .chat-message {
    max-width: 95%;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .candidate-card {
    padding: 0.4rem;
  }
  
  .candidate-name {
    font-size: 0.8rem;
  }
  
  .candidate-summary {
    font-size: 0.75rem;
  }
  
  .skill-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }
}

@media (max-width: 480px) {
  .chat-container {
    max-height: 50vh;
    padding: 0.3rem;
  }
  
  .chat-message {
    max-width: 98%;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .candidate-card {
    padding: 0.3rem;
  }
  
  .candidate-name {
    font-size: 0.75rem;
  }
  
  .candidate-summary {
    font-size: 0.7rem;
  }
  
  .skill-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }
}
