/* ============ Nokiatis Account System - Styles ============ */

:root {
  --green-primary: #00973A;
  --green-light: #00c94a;
  --green-glow: rgba(0, 199, 74, 0.3);
  --green-dim: #0d4f22;
  --bg-dark: #0a0a0a;
  --bg-card: rgba(0, 0, 0, 0.4);
  --bg-card-hover: rgba(0, 0, 0, 0.6);
  --border-color: rgba(0, 151, 58, 0.3);
  --border-dim: rgba(0, 151, 58, 0.15);
  --text-white: #ffffff;
  --text-gray: #9ca3af;
  --text-dim: #6b7280;
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.2);
  --radius: 12px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0d1b0e 100%);
  color: var(--text-white);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

/* ============ Particles ============ */

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: var(--green-light);
  border-radius: 50%;
  opacity: 0;
  animation: float linear infinite;
}

@keyframes float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ============ Header ============ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: white;
}

.logo-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-white);
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--green-light);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  color: var(--green-light);
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-logout {
  color: var(--red);
}

.btn-logout:hover {
  background: var(--red-dim);
}

/* ============ Main Content ============ */

.main-content {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ============ Hero ============ */

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 30px;
  background: rgba(0, 151, 58, 0.1);
  border: 1px solid var(--border-dim);
  color: var(--green-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--text-white);
  margin-bottom: 16px;
  line-height: 1.2;
}

.highlight {
  color: var(--green-light);
  text-shadow: 0 0 30px var(--green-glow);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

/* ============ Features Grid ============ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.feature-card {
  padding: 24px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  text-align: center;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--border-color);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-white);
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============ Stats Bar ============ */

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
  padding: 20px 32px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stat-item {
  text-align: center;
  min-width: 60px;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--green-light);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-dim);
  flex-shrink: 0;
}

/* ============ Tab Navigation ============ */

.tab-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 4px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 32px;
}

.tab-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-gray);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--green-primary);
  color: white;
}

.tab-btn:hover:not(.active) {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

/* ============ Form Card ============ */

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

.form-header {
  padding: 24px 28px 0;
}

.form-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 4px;
}

.form-header p {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.form-body {
  padding: 24px 28px 28px;
}

/* ============ Form Elements ============ */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 8px;
  font-weight: 600;
}

.optional {
  color: var(--text-dim);
  font-weight: 400;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(0, 151, 58, 0.15);
}

input::placeholder {
  color: var(--text-dim);
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  padding-left: 44px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.toggle-pass {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.2s;
}

.toggle-pass:hover {
  color: var(--text-gray);
}

.input-hint {
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 1em;
}

.checking {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-color);
  border-top-color: var(--green-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.hidden-input {
  display: none;
}

.divider {
  height: 1px;
  background: var(--border-dim);
  margin: 20px 0;
}

/* ============ Model Select ============ */

.model-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.model-btn {
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
}

.model-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.model-btn.active {
  border-color: var(--green-primary);
  background: rgba(0, 151, 58, 0.15);
  color: var(--green-light);
}

.model-emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 4px;
}

.model-name {
  font-size: 1rem;
  font-weight: 700;
  display: block;
}

.model-desc {
  font-size: 0.75rem;
  opacity: 0.7;
  display: block;
}

/* ============ Upload ============ */

.upload-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.upload-btn-wrap {
  flex: 1;
}

.btn-upload {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  background: none;
  color: var(--green-light);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-upload:hover {
  background: rgba(0, 151, 58, 0.1);
  border-color: var(--border-color);
}

.file-name {
  font-size: 0.8rem;
  color: var(--green-light);
  margin-top: 6px;
  min-height: 1em;
}

.preview-box {
  width: 96px;
  height: 96px;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-box.small {
  width: 64px;
  height: 64px;
  margin: 8px auto;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============ Buttons ============ */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px var(--green-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--green-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  width: auto;
  padding: 8px 20px;
  font-size: 0.9rem;
  margin: 8px auto;
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: none;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-danger {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--red-dim);
}

/* ============ Profile Section ============ */

.profile-section {
  animation: fadeIn 0.4s ease;
}

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

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

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

/* Profile Card */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-avatar-wrap {
  margin-bottom: 16px;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(0, 151, 58, 0.3);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-username {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
}

.profile-label {
  color: var(--green-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.profile-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-green {
  background: rgba(0, 151, 58, 0.2);
  color: var(--green-light);
  border: 1px solid rgba(0, 151, 58, 0.3);
}

.profile-info {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.info-row span:last-child {
  color: var(--text-white);
}

/* Management Card */
.management-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mgmt-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mgmt-header p {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.mgmt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.mgmt-item {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-dim);
}

.mgmt-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.current-skin-wrap,
.current-cape-wrap {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-dim);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-cape-wrap {
  width: 120px;
  height: 180px;
}

.skin-image,
.cape-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.no-skin-placeholder {
  text-align: center;
  color: var(--text-dim);
}

.no-skin-placeholder p {
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Model Toggle */
.model-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}

.toggle-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-gray);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--green-primary);
  border-color: var(--green-primary);
  color: white;
}

.toggle-btn:hover:not(.active) {
  border-color: var(--border-color);
  color: var(--text-white);
}

/* Info Box */
.info-box {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: rgba(0, 151, 58, 0.08);
  border: 1px solid var(--border-dim);
}

.info-box h4 {
  color: var(--green-light);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  font-size: 0.85rem;
  color: var(--text-gray);
  padding: 4px 0;
  padding-right: 16px;
  position: relative;
}

.info-box li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: var(--green-light);
}

/* ============ Footer ============ */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 20px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-sub {
  font-size: 0.75rem;
  margin-top: 4px;
  color: rgba(107, 114, 128, 0.5);
}

/* ============ Toast ============ */

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid var(--border-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-white);
  font-size: 0.9rem;
  min-width: 280px;
  max-width: 450px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: auto;
}

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

.toast-success { border-color: rgba(0, 199, 74, 0.4); }
.toast-error { border-color: rgba(239, 68, 68, 0.4); }
.toast-warning { border-color: rgba(251, 191, 36, 0.4); }

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
}

/* ============ Loading Overlay ============ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  text-align: center;
  color: var(--text-white);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-dim);
  border-top-color: var(--green-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-spinner p {
  font-size: 1rem;
  color: var(--text-gray);
}

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

@media (max-width: 600px) {
  .main-content {
    padding: 16px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-desc {
    font-size: 0.95rem;
  }
  
  .form-body {
    padding: 16px;
  }
  
  .form-header {
    padding: 16px 16px 0;
  }
  
  .profile-card,
  .management-card {
    padding: 16px;
  }
  
  .mgmt-item {
    padding: 12px;
  }
  
  .current-skin-wrap {
    width: 120px;
    height: 120px;
  }
  
  .current-cape-wrap {
    width: 90px;
    height: 135px;
  }
  
  .upload-row {
    flex-direction: column;
  }
  
  .preview-box {
    width: 64px;
    height: 64px;
  }
}

/* ============ Scrollbar ============ */

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

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-primary);
}

/* ============ Body Layout ============ */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}
