@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e1b4b;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Glassmorphism Container */
.app-container {
  width: 95%;
  max-width: 1200px;
  min-height: 85vh;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out;
}

/* Header */
header {
  padding: 2rem 3rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Main Content Layout */
.main-content {
  display: flex;
  flex: 1;
  padding: 3rem;
  gap: 3rem;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    text-align: center;
  }
  
  header h1 {
    font-size: 2rem;
  }

  .main-content {
    flex-direction: column;
    padding: 1.5rem;
  }
  
  .app-container {
    width: 100%;
    border-radius: 0;
    min-height: 100vh;
  }
  
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
}

/* Sidebar / Selectors */
.sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

select, input[type="text"], input[type="number"], input[type="file"] {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

select:focus, input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

/* Actions Area */
.actions-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.5s ease;
}

.actions-area.visible {
  opacity: 1;
  transform: translateX(0);
}

.action-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-main);
}

.action-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  background: linear-gradient(145deg, rgba(99,102,241,0.1), rgba(255,255,255,0));
}

.action-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.action-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.action-icon {
  font-size: 2rem;
  opacity: 0.8;
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-gradient-start);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.close-btn:hover {
  color: var(--danger);
}

.modal-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.calc-subtitle {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Calculator Inputs Layout */
.calc-inputs-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.calc-input-box {
  flex: 1;
}

.ou-divider {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .calc-inputs-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .ou-divider {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
  }
}

/* Result Area */
.result-area {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  text-align: center;
  animation: slideUp 0.4s ease;
}

.result-area h3 {
  color: var(--success);
  margin-bottom: 0.5rem;
}

.niche-result {
  font-size: 3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

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

/* Admin specific styles */
.admin-toolbar {
  padding: 1rem 3rem;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.category-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.product-card {
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid rgba(255,255,255,0.05);
}
