@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f0f4f8;
  --bg-secondary: #e8ecf1;
  --bg-card: #ffffff;
  --border: #d4dce8;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px 0 rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 40px 0 rgba(0, 0, 0, 0.15);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1a2235;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
}

/* Modern Dark Theme */
[data-theme="modern-dark"] {
  --bg: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: #1a1a1a;
  --border: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-tertiary: #808080;
  --primary: #7c3aed;
  --secondary: #a855f7;
}

/* Glowy Apple Theme */
[data-theme="glowy-apple"] {
  --bg: #0a0a0a;
  --bg-secondary: #1a0a0a;
  --bg-card: #0f0f0f;
  --border: #4a0e0e;
  --text-primary: #ff6b6b;
  --text-secondary: #ff9999;
  --text-tertiary: #cc5555;
  --primary: #ff1744;
  --secondary: #ff5252;
  background: linear-gradient(135deg, #0a0a0a 0%, #2a0a0a 100%) !important;
}

[data-theme="glowy-apple"] body {
  background: linear-gradient(135deg, #0a0a0a 0%, #2a0a0a 100%) !important;
  box-shadow: inset 0 0 60px rgba(255, 23, 68, 0.15);
}

/* Compact Mode */
[data-compact="true"] {
  font-size: 13px;
}

[data-compact="true"] .header {
  padding: 1rem 1.5rem;
  min-height: 70px;
}

[data-compact="true"] .header-title {
  font-size: 1.4rem;
}

[data-compact="true"] .container {
  padding: 1.5rem;
}

[data-compact="true"] .addon-card {
  padding: 1.2rem;
}

[data-compact="true"] .addons-grid {
  gap: 1rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #f8fafc 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Auth Screen */
#authModal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  backdrop-filter: blur(20px);
  z-index: 1000;
}

.auth-container {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  width: 100%;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 2px solid var(--primary);
  width: 100%;
  font-weight: 600;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.auth-divider {
  color: var(--text-tertiary);
  margin: 1.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-footer {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 2rem;
  line-height: 1.5;
}

/* Main Content */
#mainContent {
  display: none;
  min-height: 100vh;
}

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 85px;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 1.5rem;
}

.header-logo-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.header-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.2));
}

.header-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.header-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
  justify-content: flex-end;
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
}

.user-section > div:not(.user-avatar) {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.user-section > div:not(.user-avatar) small {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-logout {
  padding: 0.7rem 1.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 10px;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 1rem 1.8rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-bar {
  flex: 1;
  min-width: 280px;
  padding: 0.85rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  background: var(--bg-card);
  color: var(--text-primary);
}

.search-bar::placeholder {
  color: var(--text-tertiary);
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: var(--bg-card);
}

.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.addon-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 1.8rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.addon-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
}

.addon-header {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.addon-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.addon-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0.75rem 0 0 0;
  line-height: 1.5;
  font-weight: 400;
}

.addon-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 1rem 0;
  flex: 1;
  display: none;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.addon-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 1.2rem 0;
  flex-wrap: wrap;
}

.meta-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--primary);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.addon-footer {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.addon-footer .btn {
  flex: 1;
  min-width: 100px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  margin: 0;
  display: flex !important;
  width: auto;
  border-radius: 10px;
}

.btn-download {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%) !important;
  color: white !important;
  width: 100% !important;
  font-weight: 600;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-view {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
  color: white !important;
  width: 100% !important;
  text-decoration: none !important;
  font-weight: 600;
}

.btn-view:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-edit {
  background: var(--bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  font-weight: 600;
  border-radius: 10px;
}

.btn-edit:hover {
  background: rgba(99, 102, 241, 0.08);
}

.btn-delete {
  background: var(--bg);
  color: var(--danger);
  border: 1.5px solid var(--danger);
  font-weight: 600;
  border-radius: 10px;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.form-group {
  margin-bottom: 1.8rem;
}

.form-label {
  display: block;
  margin-bottom: 0.7rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.85rem;
}

.form-control {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: var(--bg-card);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
  font-family: 'Inter', sans-serif;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.4rem;
  font-weight: 500;
}

.alert {
  padding: 1.2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #be123c;
  border-color: rgba(239, 68, 68, 0.3);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.form-actions .btn {
  flex: 1;
  padding: 0.9rem 1.5rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.empty-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Detail Modal Styles */
.detail-body {
  padding: 0;
}

.detail-section {
  margin-bottom: 2.5rem;
}

.detail-section:last-of-type {
  margin-bottom: 2rem;
}

.detail-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 1rem;
}

.detail-section p {
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 0.95rem;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-info-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.detail-link {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  word-break: break-all;
  font-weight: 500;
}

.detail-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.detail-actions .btn {
  flex: 1;
  margin: 0;
  padding: 1rem 1.5rem;
}

/* Settings Page Styles */
.settings-container {
  max-width: 900px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 3rem;
}

.settings-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.settings-content {
  margin-bottom: 3rem;
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.settings-group-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.settings-group-header h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.settings-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-item-info {
  flex: 1;
}

.settings-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.settings-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

.settings-select {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.settings-select:hover {
  border-color: var(--primary);
}

.settings-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 60px;
}

.toggle-input {
  display: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--border);
}

.toggle-label::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}

.toggle-input:checked + .toggle-label {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-color: var(--primary);
}

.toggle-input:checked + .toggle-label::after {
  left: 32px;
}

.settings-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-actions .btn {
  flex: 1;
  min-width: 200px;
  padding: 1rem 1.5rem;
}

#settingsAlertContainer {
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .auth-container {
    padding: 2.5rem;
  }

  .auth-title {
    font-size: 2rem;
  }

  .header {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
  }

  .header-content {
    width: 100%;
  }

  .header-logo-title {
    gap: 1rem;
  }

  .header-logo {
    width: 48px;
    height: 48px;
  }

  .header-title {
    font-size: 1.4rem;
  }

  .header-subtitle {
    font-size: 0.8rem;
  }

  .addons-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .modal-content {
    padding: 2rem;
    border-radius: 16px;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
  }

  .search-bar {
    min-width: 100%;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .addon-footer {
    flex-direction: column;
  }

  .addon-footer .btn {
    width: 100%;
  }

  .tabs {
    gap: 0;
    margin-bottom: 1.5rem;
  }

  .tab-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }

  .settings-group {
    padding: 1.5rem;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .settings-select {
    width: 100%;
    min-width: unset;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions .btn {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 2rem;
    width: 95%;
  }

  .auth-title {
    font-size: 1.75rem;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem;
  }

  .header-logo-title {
    gap: 0.75rem;
  }

  .header-logo {
    width: 44px;
    height: 44px;
  }

  .header-title {
    font-size: 1.2rem;
  }

  .header-subtitle {
    font-size: 0.75rem;
  }

  .user-section {
    width: 100%;
  }

  .btn-logout {
    width: 100%;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .addon-card {
    padding: 1.5rem;
  }

  .modal-title {
    font-size: 1.4rem;
  }

  .settings-header h2 {
    font-size: 1.5rem;
  }

  .settings-group {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .settings-select {
    width: 100%;
    min-width: unset;
  }

  .toggle-label {
    width: 52px;
    height: 28px;
  }

  .toggle-label::after {
    width: 20px;
    height: 20px;
  }

  .toggle-input:checked + .toggle-label::after {
    left: 28px;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions .btn {
    width: 100%;
    min-width: unset;
  }
}

/* Auth Screen */
#authModal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.auth-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 3rem;
  max-width: 450px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  margin-bottom: 1rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.05);
}

.auth-divider {
  color: var(--text-secondary);
  margin: 1.5rem 0;
  font-size: 0.9rem;
  font-weight: 300;
}

.auth-footer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2rem;
}

/* Main Content */
#mainContent {
  display: none;
  min-height: 100vh;
}

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 80px;
  gap: 2rem;
  flex-wrap: wrap;
}

.header-title {
  font-size: 1.75rem;
  font-weight: 700;
  flex: 1;
  margin: 0;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
  justify-content: flex-end;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.user-section > div:not(.user-avatar) {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.btn-logout {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-bar {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  transition: all 0.2s ease;
  background: var(--bg-card);
  color: var(--text-primary);
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.addon-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.addon-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.addon-header {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.addon-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.addon-summary {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0.75rem 0 0 0;
  line-height: 1.5;
  font-weight: 400;
}

.addon-description {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 1rem 0;
  flex: 1;
  display: none;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.addon-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 1rem 0;
  flex-wrap: wrap;
}

.meta-badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

.addon-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.addon-footer .btn {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin: 0;
  display: flex !important;
  width: auto;
}

.btn-download {
  background: var(--success) !important;
  color: white !important;
  width: 100% !important;
}

.btn-download:hover {
  background: #059669 !important;
}

.btn-view {
  background: var(--primary) !important;
  color: white !important;
  width: 100% !important;
  text-decoration: none !important;
}

.btn-view:hover {
  background: var(--primary-dark) !important;
}

.btn-edit {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-edit:hover {
  background: rgba(99, 102, 241, 0.05);
}

.btn-delete {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.05);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  transition: all 0.2s ease;
  background: var(--bg);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.form-actions .btn {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Detail Modal Styles */
.detail-body {
  padding: 0.5rem 0;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section:last-of-type {
  margin-bottom: 1.5rem;
}

.detail-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.detail-section p {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
}

.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-info-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-info-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.detail-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.9rem;
  word-break: break-all;
}

.detail-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.detail-actions .btn {
  flex: 1;
  margin: 0;
}

@media (max-width: 768px) {
  .auth-container {
    padding: 2rem;
  }

  .addons-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-content {
    width: 95%;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================= */
/* Windows 7 Aero Glass Theme    */
/* ============================= */

[data-theme="windows-7"] {
    --bg: #dfe9f5;
    --bg-secondary: rgba(255,255,255,.45);
    --bg-card: rgba(255,255,255,.55);

    --border: rgba(255,255,255,.65);

    --text-primary: #111;
    --text-secondary: #444;
    --text-tertiary: #666;

    --primary: #2d89ef;
    --primary-dark: #1d5fb8;
    --secondary: #62b5ff;

    --shadow-sm: 0 1px 4px rgba(0,0,0,.18);
    --shadow-md: 0 6px 18px rgba(0,0,0,.20);
    --shadow-lg: 0 12px 28px rgba(0,0,0,.28);
}

[data-theme="windows-7"] body{
    font-family:"Segoe UI",sans-serif;

    background:
        radial-gradient(circle at top,#f7fbff,#d9e8f7 65%,#bfd6ec);

    background-attachment:fixed;
}

[data-theme="windows-7"] .header{

    background:linear-gradient(
        rgba(255,255,255,.78),
        rgba(170,210,255,.42)
    );

    backdrop-filter:blur(18px);

    border:1px solid rgba(255,255,255,.8);

    box-shadow:
        inset 0 1px rgba(255,255,255,.95),
        0 6px 20px rgba(0,0,0,.18);

}

[data-theme="windows-7"] .addon-card,
[data-theme="windows-7"] .settings-group,
[data-theme="windows-7"] .modal-content,
[data-theme="windows-7"] .auth-container{

    background:
        linear-gradient(
            rgba(255,255,255,.65),
            rgba(210,235,255,.45)
        );

    backdrop-filter:blur(18px);

    border:1px solid rgba(255,255,255,.85);

    box-shadow:

        inset 0 1px rgba(255,255,255,.95),

        0 12px 26px rgba(0,0,0,.18);
}

[data-theme="windows-7"] .btn{

    border-radius:4px;

    border:1px solid #6b91b9;

    background:
        linear-gradient(
            #fcfeff,
            #e3eefb 45%,
            #d0e3fa
        );

    color:#222;

    box-shadow:
        inset 0 1px white,
        0 1px 2px rgba(0,0,0,.18);

    transition:.15s;
}

[data-theme="windows-7"] .btn:hover{

    background:
        linear-gradient(
            #ffffff,
            #edf6ff,
            #d6ebff
        );

    border-color:#3b83d5;

}

[data-theme="windows-7"] .btn:active{

    box-shadow:
        inset 0 2px 6px rgba(0,0,0,.25);

}

[data-theme="windows-7"] .btn-primary{

    color:white;

    border-color:#2f6db3;

    background:

        linear-gradient(
            #66b9ff,
            #3b92f4 45%,
            #2a79d8
        );
}

[data-theme="windows-7"] .btn-primary:hover{

    background:

        linear-gradient(
            #8acbff,
            #53a4ff,
            #3b89ea
        );
}

[data-theme="windows-7"] input,
[data-theme="windows-7"] textarea,
[data-theme="windows-7"] select{

    border-radius:3px;

    border:1px solid #7fa7d9;

    background:white;

    box-shadow:

        inset 0 1px 2px rgba(0,0,0,.08);

}

[data-theme="windows-7"] input:focus,
[data-theme="windows-7"] textarea:focus,
[data-theme="windows-7"] select:focus{

    border-color:#3a90ff;

    box-shadow:
        0 0 8px rgba(58,144,255,.55);

}

[data-theme="windows-7"] .tab-btn.active{

    background:

        linear-gradient(
            white,
            #dbeeff
        );

    border-radius:6px 6px 0 0;

    color:#1565c0;

    border-bottom-color:white;

}

[data-theme="windows-7"] .search-bar{

    background:white;

    border:1px solid #8ab5ea;

}

[data-theme="windows-7"] .header-title{

    text-shadow:

        0 1px white,

        0 0 10px rgba(80,170,255,.35);

}

[data-theme="windows-7"] .addon-card:hover{

    transform:translateY(-6px);

    box-shadow:

        0 0 18px rgba(70,160,255,.45),

        0 16px 30px rgba(0,0,0,.20);

}

.captcha-modal {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(5, 8, 20, 0.8);
            backdrop-filter: blur(8px);
            z-index: 9999;
            padding: 1rem;
        }

        .captcha-modal.show {
            display: flex;
        }

        .captcha-modal-content {
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            padding: 1.5rem;
            width: min(100%, 420px);
            max-width: 420px;
            margin: auto;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
            position: relative;
        }

        .captcha-close {
            position: absolute;
            top: 0.75rem;
            right: 0.75rem;
            border: none;
            background: transparent;
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
        }