/* === Header & Logo === */

.logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: rgba(122, 252, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(122, 252, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
  transition: all 0.3s ease;
  user-select: none;
}

.logo:hover {
  background: rgba(122, 252, 255, 0.15);
  border-color: var(--accent);
}

.title h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  user-select: none;
}

.title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: var(--font-subtitle);
  font-weight: 400;
  user-select: none;
}

/* === Intro Section === */

.intro {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  padding: var(--spacing-lg);
  background: rgba(122, 252, 255, 0.03);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 252, 255, 0.4);
  position: relative;
  transition: all 0.3s ease;
}

.intro:hover {
  border-color: rgba(122, 252, 255, 0.6);
  background: rgba(122, 252, 255, 0.06);
}

.intro h2 {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  transition: color 0.3s ease;
}

.intro:hover h2 {
  color: var(--accent);
}

/* === Service Cards Grid === */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-md);
}

.card {
  display: block;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(122, 252, 255, 0.3);
  color: inherit;
  transition: all 0.4s var(--easing-smooth);
  position: relative;
  overflow: hidden;
  animation: floatUp 0.8s ease-out;
}

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

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  background: rgba(122, 252, 255, 0.08);
  box-shadow: 0 10px 40px rgba(122, 252, 255, 0.3), inset 0 0 20px rgba(122, 252, 255, 0.05);
}

.card:hover::before {
  left: 100%;
}

.card .meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.card .icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 24px;
  animation: iconGlow 2s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.card:hover .icon {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(122, 252, 255, 0.6);


.card h3 {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-subtitle);
}

.card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 300;
}

/* Service Card Gradients */
.card[data-service="portainer"] .icon {
  background: var(--grad-portainer);
}

.card[data-service="torrent"] .icon {
  background: var(--grad-torrent);
}

.card[data-service="jellyfin"] .icon {
  background: var(--grad-jellyfin);
}

.card[data-service="requests"] .icon {
  background: var(--grad-requests);
}

.card[data-service="radarr"] .icon {
  background: var(--grad-radarr);
}

.card[data-service="sonarr"] .icon {
  background: var(--grad-sonarr);
}

/* === Chat Widget (TARS) === */

#ai-oracle-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: var(--z-chat);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#ai-oracle-card {
  width: 360px;
  max-width: calc(100vw - 60px);
  height: 500px;
  background: rgba(5, 6, 10, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
  display: none;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

#ai-oracle-header {
  padding: 18px var(--spacing-lg);
  background: rgba(122, 252, 255, 0.05);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#ai-oracle-header h3 {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
}

#ai-oracle-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.ai-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
}

.ai-msg-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

#ai-oracle-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: var(--spacing-sm);
}

#ai-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: white;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#ai-input:focus {
  border-color: var(--accent);
}

#ai-btn-send {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  width: 45px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s;
}

#ai-btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === Toggle Button === */

#ai-toggle-btn {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: #000;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(122, 252, 255, 0.15);
  transition: all 0.4s var(--easing-bounce);
  position: relative;
}

#ai-toggle-btn:hover {
  transform: scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(122, 252, 255, 0.3);
}

.singularity-core {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 15px #fff, 0 0 30px var(--accent);
  position: relative;
  z-index: 2;
}

.singularity-ring {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse-ring 2s infinite ease-out;
  opacity: 0;
}

.singularity-ring:nth-child(2) {
  animation-delay: 0.5s;
}

/* === Close Button === */

.ai-close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  transition: color 0.2s;
}

.ai-close-btn:hover {
  color: var(--accent);
}

/* === Footer & Social === */

.social-footer {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-bottom: var(--spacing-md);
}

.instagram-card {
  padding: 12px 30px;
  display: inline-flex;
}

.instagram-icon {
  background: var(--grad-instagram);
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 14px;
}

.instagram-card h3 {
  font-size: 14px;
}

.copyright-text {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
}

/* === Responsive Design === */

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  #ai-oracle-card {
    width: 100%;
    height: 70vh;
    bottom: 90px;
    right: 0;
  }
}
