/* MEMO Universal Super-App - External CSS */

/* ============================================
   MODERN UI/UX REDESIGN - 2025
   ============================================ */

/* Modern Header */
.modern-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(20px);
}

.header-brand {
  text-align: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.logo-icon {
  font-size: 3em;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.logo-text {
  font-size: 3.5em;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

/* Modern Auth Section */
.modern-auth {
  max-width: 480px;
  margin: 0 auto;
}

.auth-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(20px);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95em;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1em;
  transition: all 0.3s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.auth-actions .btn {
  padding: 14px 24px;
  font-size: 1em;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* User Header */
.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 30px;
  backdrop-filter: blur(20px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-badge {
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95em;
}

.ws-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 0.85em;
}

.ws-status.hidden {
  display: none;
}

.status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.btn-logout {
  padding: 10px 24px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

/* Search Bar */
.app-search-container {
  margin-bottom: 30px;
}

.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  opacity: 0.5;
}

.app-search {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #fff;
  font-size: 1em;
  transition: all 0.3s ease;
}

.app-search:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Category Filters */
.category-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  overflow-x: auto;
  padding: 10px 5px;
  scrollbar-width: thin;
}

.category-filters::-webkit-scrollbar {
  height: 6px;
}

.category-filters::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.filter-btn {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.filter-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-color: transparent;
  color: #fff;
}

/* App Categories */
.app-category {
  margin-bottom: 50px;
  animation: fadeInUp 0.5s ease;
}

.app-category.hidden {
  display: none;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.category-icon {
  font-size: 1.8em;
}

.category-title {
  font-size: 1.5em;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #d0d0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* App Grid */
.app-grid-category {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.app-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.2);
}

.app-card:hover::before {
  opacity: 1;
}

.app-icon {
  font-size: 3em;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 1;
}

.app-name {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.app-desc {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .logo-text {
    font-size: 2.5em;
  }
  
  .modern-header {
    padding: 30px 20px;
  }
  
  .auth-container {
    padding: 30px 20px;
  }
  
  .auth-actions {
    grid-template-columns: 1fr;
  }
  
  .user-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .category-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  
  .app-grid-category {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

/* Reset scrollbars for TikTok-style social */
#posts-scroller::-webkit-scrollbar {
  display: none;
}

#posts-scroller {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Smooth scroll snap for social slides */
.social-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Glassmorphism effect for action buttons */
.social-action-btn {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.social-action-btn:hover {
  transform: scale(1.1);
}

.social-action-btn:active {
  transform: scale(0.95);
}

/* Story circles animation */
.story-circle {
  transition: transform 0.2s ease;
}

.story-circle:hover {
  transform: scale(1.05);
}

.story-circle:active {
  transform: scale(0.95);
}

/* Animations for slide-in */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-item {
  animation: slideInUp 0.3s ease-out;
}

/* Spinner for loading states */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive utilities */
@media (max-width: 768px) {
  .social-slide {
    font-size: 0.9em;
  }
  
  .social-action-btn {
    width: 48px !important;
    height: 48px !important;
  }
}

/* Text shadow utilities for readability */
.text-shadow-strong {
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 4px 16px rgba(0,0,0,0.7);
}

.text-shadow-medium {
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.text-shadow-light {
  text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

/* Enhanced Workspace Styling - Responsive & Centered */
.workspace {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95vw;
  max-width: 1400px;
  height: 90vh;
  max-height: 900px;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  padding: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
              0 0 100px rgba(212, 175, 55, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#workspace-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  width: 100%;
  position: relative;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.workspace-header h2 {
  font-size: 1.8em;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #d0d0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  flex: 1;
}

.btn-close {
  padding: 12px 24px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Container adjustments */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Smooth transitions */
* {
  transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
}

button, .btn, .app-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading spinner improvements */
.spinner {
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top: 4px solid #6366f1;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 1.5em;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* Input and form styling improvements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

/* ============ AI CHAT INTERFACE ============ */

.ai-chat-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Header */
.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.ai-header-info h3 {
  margin: 0;
  font-size: 1.2rem;
  color: white;
}

.ai-level-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-top: 0.25rem;
  animation: glow 2s ease-in-out infinite;
}

.ai-level-badge[data-level="1"] { background: linear-gradient(135deg, #667eea, #764ba2); }
.ai-level-badge[data-level="2"] { background: linear-gradient(135deg, #f093fb, #f5576c); }
.ai-level-badge[data-level="3"] { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.ai-level-badge[data-level="4"] { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.ai-level-badge[data-level="5"] { background: linear-gradient(135deg, #fa709a, #fee140); }
.ai-level-badge[data-level="6"] { background: linear-gradient(135deg, #30cfd0, #330867); }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}

.ai-header-right {
  display: flex;
  gap: 0.5rem;
}

.ai-btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.ai-btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Level Progress */
.ai-level-progress {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Messages Container */
.ai-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-messages-container::-webkit-scrollbar {
  width: 8px;
}

.ai-messages-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.ai-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

/* Welcome Message */
.ai-welcome-message {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-welcome-message h4 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: white;
}

.ai-welcome-message p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0;
}

.ai-welcome-message ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.ai-welcome-message li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.ai-hint {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
}

/* Chat Messages */
.ai-message {
  display: flex;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ai-message-user {
  flex-direction: row-reverse;
}

.ai-message-user .message-content {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.ai-message-ai .message-content {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.ai-message-error .message-content {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.4);
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.message-content {
  max-width: 70%;
  padding: 1rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-text {
  color: white;
  line-height: 1.6;
  word-wrap: break-word;
}

.message-text code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

.message-error {
  color: #ffcccc;
}

.message-metadata {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.message-actions button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.message-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Typing Indicator */
.ai-message-typing .message-content {
  padding: 0.75rem 1rem;
}

.typing-indicator {
  display: flex;
  gap: 0.3rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

/* Input Container */
.ai-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-input-field {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  resize: none;
  max-height: 150px;
  transition: all 0.2s ease;
}

.ai-input-field:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.ai-input-field::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.ai-send-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ai-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.ai-send-btn:active {
  transform: translateY(0);
}

/* Capabilities */
.ai-capabilities {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-capabilities details {
  color: white;
}

.ai-capabilities summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: bold;
  list-style: none;
}

.ai-capabilities summary::-webkit-details-marker {
  display: none;
}

.capabilities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.capability-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .message-content {
    max-width: 85%;
  }
  
  .ai-chat-header h3 {
    font-size: 1rem;
  }
  
  .ai-icon {
    font-size: 1.5rem;
  }
  
  .ai-welcome-message {
    padding: 1.5rem;
  }
}

/* Balance Display Cards */
.balance-display {
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  color: #fff;
  font-size: 2.5em;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.balance-display:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   AUTO-ADAPTATION & RESPONSIVE SYSTEM
   ============================================ */

/* Container Query Support */
@supports (container-type: inline-size) {
  .app-content-wrapper {
    container-type: inline-size;
    container-name: app-content;
  }
}

/* Horizontal Slider Containers */
.slider-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 15px 5px;
  margin: 0 -5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.1);
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.slider-container::-webkit-scrollbar {
  height: 8px;
}

.slider-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.slider-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 10px;
  transition: background 0.3s;
}

.slider-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #764ba2, #667eea);
}

/* Slider Navigation Buttons */
.slider-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  opacity: 0;
  transition: opacity 0.3s;
}

.slider-container:hover + .slider-nav,
.slider-nav:hover {
  opacity: 1;
}

.slider-nav-btn {
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2em;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.slider-nav-btn:hover {
  background: rgba(99, 102, 241, 0.5);
  transform: scale(1.1);
}

.slider-nav-btn:active {
  transform: scale(0.95);
}

/* Slider Items */
.slider-item {
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: transform 0.3s;
}

.slider-item:hover {
  transform: scale(1.02);
}

/* Adaptive Grid System */
.adaptive-grid {
  display: grid;
  gap: 15px;
  width: 100%;
}

/* Auto-fit grid for different screen sizes */
.adaptive-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.adaptive-grid-photos {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.adaptive-grid-music {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.adaptive-grid-files {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
}

/* Container Queries for Responsive Components */
@container app-content (max-width: 600px) {
  .adaptive-grid {
    grid-template-columns: 1fr;
  }
  
  .balance-display {
    font-size: 1.8em !important;
    padding: 20px !important;
  }
  
  .message-content {
    max-width: 90% !important;
  }
}

@container app-content (min-width: 601px) and (max-width: 900px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

@container app-content (min-width: 901px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Touch-Friendly Enhancements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .app-card {
    min-height: 120px;
  }
  
  .slider-container {
    gap: 20px;
    padding: 20px 10px;
  }
  
  .slider-nav {
    opacity: 1;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 900px) and (orientation: landscape) {
  .workspace {
    width: 98vw;
    height: 95vh;
    max-height: none;
    padding: 10px;
  }
  
  .workspace-header {
    padding: 10px 15px;
    margin-bottom: 10px;
  }
  
  .workspace-header h2 {
    font-size: 1.3em;
  }
  
  .balance-display {
    font-size: 1.5em !important;
    padding: 15px !important;
  }
  
  .modern-header {
    padding: 20px !important;
  }
}

/* Tablet Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .app-grid-category {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  
  .workspace {
    width: 96vw;
    height: 92vh;
    padding: 15px;
  }
  
  .workspace-header h2 {
    font-size: 1.5em;
  }
}

/* Desktop Large Screen Optimization */
@media (min-width: 1440px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .app-grid-category {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .workspace {
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* Ultra-Wide Screen Optimization */
@media (min-width: 2560px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .workspace {
    max-width: 2200px;
  }
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  color: #fff;
}

.status-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.status-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.status-unread {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

/* List Items */
.note-item,
.task-item,
.email-item,
.file-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.3s ease;
}

.note-item:hover,
.task-item:hover,
.email-item:hover,
.file-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(5px);
}

.task-item.priority-high {
  border-left: 4px solid #ef4444;
}

.task-item.priority-medium {
  border-left: 4px solid #f59e0b;
}

.task-item.priority-low {
  border-left: 4px solid #10b981;
}

/* ============================================
   ENHANCED MOBILE & TABLET RESPONSIVENESS
   ============================================ */

/* AI Chat Improvements */
#ai-chat-container {
  max-height: 70vh;
}

#ai-messages {
  max-height: 55vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 10px;
}

#ai-messages::-webkit-scrollbar {
  width: 6px;
}

#ai-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

#ai-messages::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 10px;
}

#ai-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

#ai-input {
  transition: all 0.3s;
}

#ai-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

/* Calendar Month Groups */
.calendar-month-group {
  animation: fadeInUp 0.4s ease;
}

input[type="month"],
input[type="datetime-local"] {
  cursor: pointer;
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
  .logo-text {
    font-size: 2em !important;
    letter-spacing: -1px;
  }
  
  .modern-header {
    padding: 20px 15px !important;
  }
  
  .app-card {
    min-width: 130px;
    padding: 15px 10px;
  }
  
  .app-icon {
    font-size: 2em;
  }
  
  .app-name {
    font-size: 0.85em;
  }
  
  .slider-item {
    min-width: 240px !important;
    width: 240px !important;
  }
  
  .balance-display {
    font-size: 1.5em !important;
    padding: 15px !important;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.85em;
  }
  
  .workspace {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    top: 0;
    left: 0;
    transform: none;
    padding: 10px;
    margin: 0;
  }
  
  .workspace-header {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .workspace-header h2 {
    font-size: 1.2em;
  }
  
  #workspace-content {
    padding: 0;
  }
  
  .btn-close {
    padding: 8px 16px;
    font-size: 0.85em;
  }
  
  .file-item, .note-item, .task-item, .email-item {
    padding: 12px;
  }
}

/* Mobile Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .slider-container {
    gap: 20px;
    padding: 20px 10px;
  }
  
  .slider-item {
    min-width: 280px;
  }
  
  .slider-nav {
    opacity: 1;
    margin-top: 10px;
  }
  
  .file-item, .note-item, .task-item, .email-item {
    padding: 15px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9em;
  }
  
  .workspace {
    width: 98vw;
    height: 96vh;
    padding: 12px;
    border-radius: 10px;
  }
  
  .workspace-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  
  .workspace-header h2 {
    font-size: 1.4em;
  }
  
  .balance-display {
    font-size: 1.8em !important;
    padding: 20px !important;
  }
  
  .message-content {
    max-width: 85%;
  }
}

/* Tablet Portrait (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .app-grid-category {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  
  .workspace {
    padding: 25px;
  }
  
  .slider-container {
    gap: 18px;
  }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .workspace {
    max-height: 85vh;
    overflow-y: auto;
  }
  
  .adaptive-grid-auto {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .balance-display {
    font-size: 2em !important;
  }
}

/* Desktop (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Desktop (1441px - 2560px) */
@media (min-width: 1441px) and (max-width: 2560px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .app-grid-category {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .workspace {
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* Ultra-Wide (2561px+) */
@media (min-width: 2561px) {
  .adaptive-grid-auto {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .adaptive-grid-photos {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .workspace {
    max-width: 2200px;
    margin: 0 auto;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .app-icon {
    transform: scale(0.95);
  }
  
  .logo-icon {
    filter: drop-shadow(0 6px 16px rgba(99, 102, 241, 0.5));
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --dark: #0f172a;
    --light: #1e293b;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .slider-container {
    scroll-behavior: auto;
  }
}

/* AI Panel Slide Animation */
#ai-toggle-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6) !important;
}

#ai-toggle-btn:active {
  transform: scale(0.95) !important;
}

#code-ai-panel {
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AI Panel Close Button Hover */
#code-ai-panel button:hover {
  background: rgba(255,255,255,0.1) !important;
}

/* AI Input Focus */
#ai-prompt-input:focus {
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
  outline: none;
}

/* Print Styles */
@media print {
  .btn, .slider-nav, .modern-header, .category-filters, .workspace-header .btn {
    display: none !important;
  }
  
  .workspace {
    box-shadow: none;
    border: 1px solid #ccc;
    background: white;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .file-item, .note-item, .task-item, .email-item {
    background: white;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

