/* PickleChat® Modern Redesign - Zöld téma */

:root {
  --primary: #4CAF50;
  --primary-light: #66BB6A;
  --primary-dark: #2E7D32;
  --accent: #8BC34A;
  --dark-bg: rgba(0, 0, 0, 0.4);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 30% 20%, #1B5E20 0%, #0d3317 50%, #051a0c 100%);
  background-attachment: fixed;
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated gradient mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 10% 10%, rgba(76, 175, 80, 0.15), transparent 40%),
    radial-gradient(ellipse at 90% 90%, rgba(139, 195, 74, 0.12), transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(46, 125, 50, 0.08), transparent 50%);
  animation: meshMove 25s ease-in-out infinite alternate;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(76,175,80,0.03)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  z-index: -1;
  opacity: 0.5;
}

@keyframes meshMove {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-5%, 5%) scale(1.1); }
}

/* ============= AUTH CONTAINER ============= */
#auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

.auth-container {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

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

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

.auth-container h1 {
  color: var(--primary-light);
  margin-bottom: 12px;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  position: relative;
  z-index: 1;
}

.auth-container h2 {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 36px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
}

#pickle {
  width: 100px;
  height: 100px;
  margin: 24px 0;
  filter: drop-shadow(0 8px 16px rgba(76, 175, 80, 0.4));
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
}

/* ============= MAIN APP LAYOUT ============= */
#mainApp {
  display: none;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 72px;
  height: 100vh;
  background: var(--dark-bg);
  backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.rooms-section {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.rooms-section::-webkit-scrollbar {
  width: 4px;
}

.rooms-section::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.navigation-section {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.content {
  margin-left: 72px;
  padding: 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(100% - 72px);
}

/* ============= NAVIGATION ICONS ============= */
.nav-icon {
  cursor: pointer;
  padding: 14px;
  margin: 6px 12px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  position: relative;
  background: transparent;
}

.nav-icon:hover {
  background: var(--glass-hover);
  color: var(--primary-light);
  transform: scale(1.05);
}

.nav-icon.active {
  background: var(--glass);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.nav-icon.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.6);
}

/* ============= ROOM ITEMS ============= */
.room-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 12px;
  margin: 6px 12px;
  position: relative;
  background: transparent;
}

.room-item:hover {
  background: var(--glass-hover);
  transform: translateX(4px) scale(1.02);
}

.room-item:hover::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--primary), transparent);
  border-radius: 0 2px 2px 0;
}

.room-icon {
  padding: 14px;
  text-align: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.room-item:hover .room-icon {
  color: var(--primary-light);
  filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.5));
}

/* ============= VIEWS ============= */
.view {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

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

/* ============= HOME VIEW ============= */
.home-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 24px;
}

.home-content h1 {
  color: var(--primary-light);
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 48px;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-content > div {
  width: 100%;
  max-width: 700px;
  display: grid;
  gap: 24px;
}

.home-content > div > div {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.home-content > div > div::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top left, rgba(76, 175, 80, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.home-content > div > div:hover {
  background: var(--glass-hover);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(76, 175, 80, 0.3);
}

.home-content > div > div:hover::before {
  opacity: 1;
}

.home-content h2 {
  color: var(--primary-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

/* ============= FORM ELEMENTS ============= */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

input[type="text"], 
input[type="email"], 
input[type="password"] {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  color: white;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  font-weight: 500;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15), 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.form-group small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  text-align: left;
  font-weight: 500;
}

/* ============= BUTTONS ============= */
button {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 5px;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  opacity: 1;
}

button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
}

button:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

button:active {
  transform: translateY(-1px) scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============= CHAT STYLES ============= */
.chat-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

.chat-header {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.chat-header h2 {
  margin: 0 0 12px 0;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chat-header p {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

#messagesList {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  padding: 24px;
  max-height: 500px;
  overflow-y: auto;
  scroll-behavior: smooth;
  border: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

#messagesList::-webkit-scrollbar {
  width: 8px;
}

#messagesList::-webkit-scrollbar-track {
  background: var(--glass);
  border-radius: 8px;
}

#messagesList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
}

#messagesList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

.message {
  animation: slideInMessage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 12px 0;
  padding: 14px 18px;
  background: var(--glass);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message:hover {
  background: var(--glass-hover);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.message p {
  margin: 0;
  word-wrap: break-word;
  line-height: 1.6;
}

.message strong {
  color: var(--primary-light);
  font-weight: 700;
}

.chat-input-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  border: 1px solid var(--border);
}

#messageInput {
  flex: 1;
  margin: 0;
}

.chat-controls {
  text-align: center;
  margin-top: 16px;
}

/* ============= SETTINGS ============= */
.settings-container {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 24px;
}

.settings-container h1 {
  color: var(--primary-light);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-section {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 32px;
  border-radius: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-shadow: var(--shadow);
}

.settings-section:hover {
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.settings-section h3 {
  color: var(--primary-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#userInfo {
  padding: 24px;
  background: var(--glass);
  border-radius: 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  backdrop-filter: blur(10px);
}

#userInfo p {
  margin: 12px 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

#userInfo strong {
  color: var(--primary-light);
  font-weight: 700;
}

/* ============= SUCCESS MESSAGE ============= */
#successMessage {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  background: var(--glass);
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* ============= EMOJI STYLES ============= */
.emoji {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 2px;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: inline-block;
}

.emoji:hover {
  transform: scale(1.3) rotate(10deg);
}

.emoji-help {
  margin-top: 20px;
  padding: 20px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  border-left: 3px solid var(--primary);
}

.emoji-help strong {
  color: var(--primary-light);
}

.emoji-suggestions {
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.emoji-suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 4px;
}

.emoji-suggestion-item:hover {
  background: rgba(76, 175, 80, 0.2);
}

.emoji-suggestion-item .emoji-code {
  font-family: 'Fira Code', monospace;
  color: var(--primary-light);
  font-weight: 600;
}

/* ============= TOOLTIP ============= */
#roomTooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10000;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-width: 200px;
  word-wrap: break-word;
  border: 1px solid var(--border);
}

/* ============= TOAST NOTIFICATIONS ============= */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  z-index: 10001;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  word-wrap: break-word;
  backdrop-filter: blur(20px) saturate(180%);
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  background: rgba(76, 175, 80, 0.95);
  color: white;
  border-left: 4px solid var(--primary);
}

.toast-error {
  background: rgba(244, 67, 54, 0.95);
  color: white;
  border-left: 4px solid #f44336;
}

/* ============= LINKS ============= */
a {
  color: var(--primary-light);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-light);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

a:hover {
  color: var(--accent);
}

/* ============= LOADING STATES ============= */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============= RESPONSIVE DESIGN ============= */
@media (max-width: 768px) {
  .sidebar {
    width: 64px;
  }
  
  .content {
    margin-left: 64px;
    padding: 20px;
    width: calc(100% - 64px);
  }
  
  .home-content h1 {
    font-size: 2.5rem;
  }
  
  .settings-container h1 {
    font-size: 2.2rem;
  }
  
  .nav-icon {
    padding: 12px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 56px;
  }
  
  .content {
    margin-left: 56px;
    padding: 16px;
    width: calc(100% - 56px);
  }
  
  .home-content h1 {
    font-size: 2rem;
  }
  
  .auth-container h1 {
    font-size: 2.2rem;
  }
  
  button {
    padding: 12px 24px;
    font-size: 14px;
  }
  
  #pickle {
    width: 80px;
    height: 80px;
  }
}

/* ============= PRINT STYLES ============= */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .sidebar, .navigation-section {
    display: none !important;
  }
  
  .content {
    margin-left: 0 !important;
  }
}