* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fb;
  color: #1a1a2e;
  transition: all 0.3s ease;
  padding: 0 20px;
}

/* Dark Theme */
body.dark {
  background: #0f0f1a;
  color: #e4e4e7;
}

body.dark .card {
  background: #1e1e2a;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark .card.folder-card {
  background: #1e1e2a;
  border: 2px solid #667eea;
}

body.dark input, 
body.dark textarea,
body.dark select {
  background: #2a2a35;
  color: #e4e4e7;
  border-color: #3a3a45;
}

body.dark .header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark .product-item {
  background: #2a2a35;
}

body.dark .popup {
  background: #1e1e2a;
  color: white;
}

body.dark .cats button {
  background: #1e1e2a;
  border-color: #3a3a45;
  color: #a0a0b0;
}

body.dark .admin-container {
  background: #1e1e2a;
}

body.dark .login-box {
  background: #1e1e2a;
}

body.dark .social-links {
  border-top-color: #2a2a35;
}

body.dark footer {
  border-top-color: #2a2a35;
}

h1, h2 {
  margin: 20px 0;
  font-weight: 600;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px 20px;
  border-radius: 20px;
  margin: 20px 0;
  text-align: center;
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header h1 {
  margin: 0;
  font-size: 2.5rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

/* Search Bar */
.search-container {
  max-width: 500px;
  margin: 20px auto;
}

#search {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
}

#search:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Category Buttons */
.cats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 30px 0;
}

.cats button {
  padding: 10px 24px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  color: #666;
}

.cats button:hover,
.cats button.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* Products Grid */
#products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 20px 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Product Card */
.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card.folder-card {
  border: 2px solid #667eea;
  cursor: pointer;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.card h3 {
  padding: 15px 15px 5px;
  font-size: 1.1rem;
  margin: 0;
}

/* Views Badge */
.views-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #667eea;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 5px 15px;
}

/* Product Buttons Container */
.product-buttons {
  padding: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.amazon { background: #ff9900; }
.flipkart { background: #2874f0; }
.meesho { background: #e91e63; }
.myntra { background: #e62e4a; }
.shopsy { background: #ff6b35; }
.ajio { background: #ff9900; }
.nykaa { background: #f15a6c; }
.tatacliq { background: #4a8bff; }

/* Popup Notification */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  padding: 20px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 2000;
  text-align: center;
  animation: slideIn 0.3s ease;
  max-width: 350px;
  width: 90%;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.popup p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.popup a {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.popup a:hover {
  background: #5a67d8;
  transform: scale(1.02);
}

.popup span {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 20px;
  color: #999;
  transition: color 0.3s;
}

.popup span:hover {
  color: #ff4444;
}

/* Telegram Floating Button */
.telegram-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0088cc;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 32px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 1000;
  animation: pulse 2s infinite;
}

.telegram-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,136,204,0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0,136,204,0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0,136,204,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0,136,204,0);
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 30px;
  margin-top: 40px;
  border-top: 1px solid #e0e0e0;
}

footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

/* Social Links in Footer */
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 25px;
  background: rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
  font-size: 14px;
}

.social-links a:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.social-links a img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* Admin Panel Styles */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.admin-input {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.admin-input:focus {
  outline: none;
  border-color: #667eea;
}

.publish-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.publish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.publish-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Products List in Admin */
.products-list {
  margin-top: 40px;
}

.product-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.product-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.product-info {
  flex: 1;
}

.product-info h4 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.edit-btn, .delete-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.edit-btn {
  background: #667eea;
  color: white;
}

.delete-btn {
  background: #ff4757;
  color: white;
}

.edit-btn:hover, .delete-btn:hover {
  transform: translateY(-2px);
}

/* Add Link Button */
.add-link-btn {
  background: #667eea;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin: 10px 0;
  transition: all 0.3s ease;
}

.add-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.remove-link-btn {
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 16px;
}

.remove-link-btn:hover {
  transform: scale(1.1);
}

.platform-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}

/* Login Page */
.login-box {
  max-width: 400px;
  margin: 100px auto;
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-box input {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Folder Product Item in Admin */
.folder-product-item {
  background: #f8f9fa;
  padding: 15px;
  margin: 10px 0;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

body.dark .folder-product-item {
  background: #2a2a35;
}

.folder-product-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #667eea;
}

/* Modal for Folder View */
.folder-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
}

.folder-modal-content {
  background: white;
  max-width: 800px;
  width: 100%;
  border-radius: 20px;
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

body.dark .folder-modal-content {
  background: #1e1e2a;
}

.folder-modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: #ff4757;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

.folder-product-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.dark .folder-product-card {
  background: #2a2a35;
}

.folder-product-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.folder-product-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  #products {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .product-item {
    flex-direction: column;
    text-align: center;
  }
  
  .product-actions {
    width: 100%;
    justify-content: center;
  }
  
  .social-links {
    gap: 10px;
  }
  
  .social-links a {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .admin-container {
    padding: 15px;
  }
}