/* === BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #e0f7ff 0%, #fff0f5 50%, #f0fff0 100%);
  min-height: 100vh;
  color: #2c3e50;
}

/* === FLOATING STARS DECORATION === */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  font-size: 1.4rem;
  opacity: 0.35;
  z-index: 0;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, #ff6b9d 0%, #ff8c42 50%, #ffcc02 100%);
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
  position: relative;
  z-index: 1;
}

.header-admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header-emoji {
  font-size: 2.2rem;
}

.header h1 {
  font-size: 2.4rem;
  font-weight: 900;
  color: white;
  text-shadow: 2px 3px 0 rgba(0,0,0,0.15);
  letter-spacing: -0.5px;
}

.header-subtitle {
  margin-top: 10px;
  color: rgba(255,255,255,0.92);
  font-size: 1.05rem;
  font-weight: 600;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* === MAIN === */
.main {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* === TOYS GRID === */
.toys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.toy-card {
  background: white;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toy-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ff6b9d, #ffcc02, #4ecdc4);
  z-index: -1;
}

.toy-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
}

.toy-icon {
  font-size: 2.8rem;
  text-align: center;
}

.toy-info {
  text-align: center;
}

.toy-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2c3e50;
  line-height: 1.3;
  margin-bottom: 8px;
}

.toy-price {
  font-size: 1rem;
  font-weight: 700;
  color: #ff8c42;
  background: #fff4e6;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
}

.toy-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

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

.btn-shop {
  background: linear-gradient(135deg, #4ecdc4, #2bc0b4);
  color: white;
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
  width: 100%;
}

.btn-bought {
  background: linear-gradient(135deg, #56ab2f, #a8e063);
  color: white;
  box-shadow: 0 4px 12px rgba(86, 171, 47, 0.4);
  width: 100%;
}

.btn-bought:hover {
  box-shadow: 0 6px 20px rgba(86, 171, 47, 0.5);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 65, 108, 0.35);
  padding: 10px 18px;
  font-size: 0.9rem;
}

.btn-outline {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.35);
}

.btn-full {
  width: 100%;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}

.empty-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 10px;
}

.empty-state p {
  color: #7f8c8d;
  font-size: 1.05rem;
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 30px 16px;
  color: #7f8c8d;
  font-weight: 700;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

/* === LOGIN PAGE === */
.login-box {
  max-width: 420px;
  margin: 0 auto;
  background: white;
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

.login-box h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #2c3e50;
  margin-bottom: 8px;
}

.login-box > p {
  color: #7f8c8d;
  font-size: 1rem;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.login-back {
  margin-top: 24px;
  font-size: 0.95rem;
}

.login-back a {
  color: #667eea;
  text-decoration: none;
  font-weight: 700;
}

.login-back a:hover {
  text-decoration: underline;
}

/* === FORMS === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group label {
  font-weight: 800;
  font-size: 0.95rem;
  color: #34495e;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid #e8ecf0;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.required {
  color: #ff416c;
}

/* === ALERTS === */
.alert {
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.alert-error {
  background: #fff0f0;
  color: #c0392b;
  border: 2px solid #ffcccc;
}

.alert-success {
  background: #f0fff4;
  color: #27ae60;
  border: 2px solid #b2f2bb;
}

/* === ADMIN PANEL === */
.admin-body {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf5 100%);
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-section {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.admin-section h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #2c3e50;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #f0f3f7;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.admin-toys-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-toy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #f8fafd;
  border-radius: 16px;
  border: 2px solid #edf0f5;
  transition: border-color 0.2s;
}

.admin-toy-row:hover {
  border-color: #c5d0e6;
}

.admin-toy-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.admin-toy-name {
  font-weight: 800;
  font-size: 1rem;
  color: #2c3e50;
}

.admin-toy-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ff8c42;
  background: #fff4e6;
  padding: 3px 10px;
  border-radius: 20px;
}

.admin-toy-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: #667eea;
  text-decoration: none;
}

.admin-toy-link:hover {
  text-decoration: underline;
}

.admin-toy-row--bought {
  background: #f5f5f5;
  border-color: #e0e0e0;
  opacity: 0.8;
}

.admin-toy-row--bought:hover {
  border-color: #bdbdbd;
}

.admin-toy-name--bought {
  color: #9e9e9e;
  text-decoration: line-through;
}

.admin-bought-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: #27ae60;
  background: #eafaf1;
  border: 1.5px solid #a9dfbf;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.admin-toy-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-restore {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: white;
  box-shadow: 0 4px 12px rgba(247, 151, 30, 0.35);
  padding: 10px 16px;
  font-size: 0.9rem;
}

.admin-section-note {
  color: #7f8c8d;
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 600;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .header-emoji {
    font-size: 1.7rem;
  }

  .toys-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-section {
    padding: 20px 16px;
  }

  .admin-toy-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-box {
    padding: 28px 20px;
  }
}
