/* ============================================
   nodrift.ch - Component Styles
   ============================================ */

/* Navbar */
.navbar {
  background: var(--bg-card);
  border-bottom: var(--border-width) solid var(--border-light);
  padding: var(--space-sm) var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-light);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
}

.navbar-brand span {
  color: var(--primary);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.navbar-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.1s;
  padding: var(--space-sm) 0;
  border-bottom: 2px solid transparent;
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.navbar-email {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Navbar Credits Display */
.navbar-credits {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-input);
  border: 2px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.navbar-credits:hover {
  background: var(--primary);
  color: var(--bg);
}

.navbar-credits svg {
  flex-shrink: 0;
}

.navbar-credits-value {
  font-family: "JetBrains Mono", monospace;
}

/* Mobile Menu Credits */
.mobile-menu-credits {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.mobile-menu-credits:hover {
  background: var(--primary);
  color: var(--bg);
}

/* Node Card */
.node-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-light);
  padding: var(--space-lg);
  transition: all 0.15s ease;
}

.node-card:hover {
  border-color: var(--primary);
  box-shadow: 6px 6px 0 var(--primary-glow);
}

.node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.node-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.node-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.node-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  padding: var(--space-md) 0;
  border-top: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
}

.node-stat {
  text-align: center;
}

.node-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
}

.node-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Job Item */
.job-item {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-light);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.job-item:hover {
  border-color: var(--primary);
}

.job-url {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-progress {
  width: 200px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-light);
  padding: var(--space-lg);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-sm);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  border: var(--border-width) dashed var(--border-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* Alert */
.alert {
  padding: var(--space-md);
  border: var(--border-width) solid;
  margin-bottom: var(--space-md);
}

.alert-error {
  background: rgba(255, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

.alert-success {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--success);
  color: var(--success);
}

/* OAuth Buttons */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.btn-oauth {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-light);
  border: var(--border-width) solid var(--border-light);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  transition: all 0.1s ease;
}

.btn-oauth:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border-light);
}

.btn-oauth:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--border-light);
}

.btn-google:hover {
  border-color: #4285f4;
  box-shadow: 2px 2px 0 #4285f4;
}

.btn-github:hover {
  border-color: #fff;
  box-shadow: 2px 2px 0 #fff;
}

.oauth-icon {
  flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--border-light);
}

/* Language Switcher - Neo Brutalism */
.lang-switcher {
  position: relative;
  z-index: 100;
  display: inline-block;
}

.lang-switcher .lang-current {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 3px solid var(--border-light);
  box-shadow: 3px 3px 0 var(--border-light);
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}

.lang-switcher .lang-current:hover {
  border-color: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}

.lang-switcher .lang-current.open {
  border-color: var(--primary);
  box-shadow: 2px 2px 0 var(--primary);
  transform: translate(1px, 1px);
}

.lang-switcher .lang-flag {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
}

.lang-switcher .lang-code {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.lang-switcher .lang-arrow {
  transition: transform 0.15s ease;
  color: var(--text-muted);
  display: inline-block;
}

.lang-switcher .lang-current.open .lang-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.lang-switcher .lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 3px solid var(--primary);
  box-shadow: 6px 6px 0 var(--primary);
  display: none !important;
  visibility: hidden;
  opacity: 0;
}

.lang-switcher .lang-dropdown.open {
  display: block !important;
  visibility: visible;
  opacity: 1;
}

.lang-switcher .lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-light);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: left;
  font-family: inherit;
}

.lang-switcher .lang-option:last-child {
  border-bottom: none;
}

.lang-switcher .lang-option:hover {
  background: var(--bg-hover);
  padding-left: 1.25rem;
}

.lang-switcher .lang-option.active {
  background: rgba(0, 212, 255, 0.1);
}

.lang-switcher .lang-option .lang-flag {
  font-size: 1.25rem;
}

.lang-switcher .lang-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
}

.lang-switcher .lang-code-small {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border: 2px solid var(--border-light);
}

.lang-switcher .lang-check {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--primary);
}

/* ============================================
   Brand Logo with DRIFT Icon
   ============================================ */

.brand-logo {
  height: 4em;
  width: auto;
  vertical-align: middle;
  margin-left: 0.15em;
  margin-top: -0.5em;
  margin-bottom: -0.5em;
  display: inline-block;
  filter: brightness(0) invert(1);
}

.navbar-brand .brand-logo {
  height: 4em;
}

.landing-logo .brand-logo {
  height: 4em;
}

.landing-logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
}

/* ============================================
   Neo-Brutalism Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-container {
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
    max-width: none;
  }
}

.toast {
  background: var(--bg-card);
  border: 3px solid var(--border-light);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.8);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-success {
  border-color: var(--success);
  box-shadow: 6px 6px 0 var(--success);
}

.toast-error {
  border-color: var(--error);
  box-shadow: 6px 6px 0 var(--error);
}

.toast-warning {
  border-color: var(--warning);
  box-shadow: 6px 6px 0 var(--warning);
}

.toast-info {
  border-color: var(--info);
  box-shadow: 6px 6px 0 var(--info);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 24px;
  height: 24px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--text-light);
  transform: scale(1.1);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  transition: width linear;
}

/* ============================================
   Mobile Navigation
   ============================================ */

/* Burger Button */
.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid var(--border-light);
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
}

.navbar-burger:hover {
  border-color: var(--primary);
}

.burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-light);
  transition: all 0.3s ease;
}

.navbar-burger.active {
  border-color: var(--primary);
}

.navbar-burger.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-burger.active .burger-line:nth-child(2) {
  opacity: 0;
}

.navbar-burger.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-header {
  padding: var(--space-lg);
  border-bottom: 2px solid var(--border-light);
  background: var(--bg-input);
}

.mobile-menu-email {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
  margin-bottom: var(--space-sm);
}

.mobile-menu-credits {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.mobile-menu-credits:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
}

.mobile-menu-credits svg {
  flex-shrink: 0;
}

.mobile-menu-nav {
  flex: 1;
  padding: var(--space-md) 0;
  overflow-y: auto;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-left: 4px solid transparent;
  transition: all 0.15s ease;
}

.mobile-menu-link:hover {
  background: var(--bg-input);
  border-left-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-link.active {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-link svg {
  flex-shrink: 0;
  color: var(--primary);
}

.mobile-menu-footer {
  padding: var(--space-lg);
  border-top: 2px solid var(--border-light);
  background: var(--bg-input);
}

/* Mobile Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Body state when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* ============================================
   Mobile Responsive Breakpoints
   ============================================ */

@media (max-width: 768px) {
  /* Show burger, hide desktop nav */
  .navbar-burger {
    display: flex;
  }

  .navbar-nav-desktop,
  .navbar-user-desktop {
    display: none !important;
  }

  .navbar-inner {
    padding: 0 var(--space-sm);
  }

  .navbar-brand .brand-logo {
    height: 3em;
  }

  /* Adjust container padding */
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  /* Dashboard adjustments */
  .dashboard-header {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: left;
  }

  .dashboard-header-content {
    text-align: left;
  }

  .dashboard-title {
    font-size: 1.5rem;
  }

  .credits-card {
    width: 100%;
    min-width: unset;
  }

  .credits-card-header {
    justify-content: center;
  }

  .credits-card-meta {
    justify-content: center;
    gap: var(--space-lg);
  }

  .dashboard-stats {
    flex-direction: column;
  }

  .stat-item {
    min-width: 100%;
  }

  /* Section titles */
  .section-title {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
  }

  .section-title svg {
    width: 18px;
    height: 18px;
  }

  /* Template cards */
  .template-card {
    padding: var(--space-md);
  }

  .template-header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .template-name {
    font-size: 1rem;
  }

  .template-tools code {
    font-size: 0.75rem;
  }

  /* Running container cards */
  .container-card {
    padding: var(--space-md);
  }

  .container-card-header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .container-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .container-actions .btn {
    flex: 1;
    min-width: 0;
  }

  /* Profile grid */
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-section.full-width {
    grid-column: 1;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  /* Credits card */
  .credits-amount {
    font-size: 2.5rem;
  }

  /* Billing grid */
  .billing-grid {
    grid-template-columns: 1fr;
  }

  .billing-section.full-width {
    grid-column: 1;
  }

  .balance-amount {
    font-size: 2.5rem;
  }

  /* Pricing table on billing page */
  .pricing-row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    text-align: left;
  }

  .pricing-row.header {
    display: none;
  }

  .pricing-row span {
    display: block;
  }

  .pricing-row span:nth-child(1) {
    font-weight: 700;
    margin-bottom: var(--space-xs);
  }

  .pricing-row span:nth-child(2),
  .pricing-row span:nth-child(3),
  .pricing-row span:nth-child(4) {
    font-size: 0.875rem;
    text-align: left !important;
  }

  .pricing-row span:nth-child(2)::before {
    content: "RAM: ";
    color: var(--text-muted);
  }

  .pricing-row span:nth-child(3)::before {
    content: "Preis: ";
    color: var(--text-muted);
  }

  .pricing-row span:nth-child(4)::before {
    content: "Pro Stunde: ";
    color: var(--text-muted);
  }

  /* Templates grid */
  .templates-grid {
    grid-template-columns: 1fr;
  }

  /* Container meta */
  .container-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  /* Job cards */
  .job-card-header {
    flex-wrap: wrap;
  }

  .job-info {
    order: 2;
    width: 100%;
    margin-top: var(--space-sm);
  }

  .job-status {
    order: 1;
    margin-left: auto;
  }

  /* Admin stats */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .server-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .server-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .server-actions .btn {
    flex: 1;
  }
}

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

  .quick-amounts {
    flex-direction: column;
  }

  .quick-amount-btn {
    min-width: 100%;
  }

  .credits-input-group {
    flex-direction: column;
  }

  .credits-adjust-btn {
    width: 100%;
    border: 3px solid var(--border-light) !important;
  }

  .credits-adjust-btn:first-child {
    border-right: 3px solid var(--border-light) !important;
  }

  .credits-adjust-btn:last-child {
    border-left: 3px solid var(--border-light) !important;
  }
}
