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

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #10b981;
  --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  --surface-color: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(255, 255, 255, 0.4);
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Utilities */
.glass {
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

/* Login Page Styling */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  text-align: center;
}

.login-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.login-card p {
  color: var(--text-light);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
  background: rgba(255,255,255,0.8);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  font-family: 'Outfit', sans-serif;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  width: auto;
}

.btn-danger {
  background: var(--danger-color);
}
.btn-danger:hover {
  background: #dc2626;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.divider:not(:empty)::before {
  margin-right: .75em;
}

.divider:not(:empty)::after {
  margin-left: .75em;
}

.divider span {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-google {
  background: white;
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-google img {
  width: 20px;
  height: 20px;
}

.btn-google:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-dark);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links span {
  font-weight: 500;
}

/* Dashboard */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-block {
  margin-bottom: 3rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.4);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(0,0,0,0.05);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.app-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 2;
}

.menu-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 0.25rem 0.5rem;
}

.card-menu-dropdown {
  position: absolute;
  top: 2rem;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 150px;
}

.card-menu-dropdown.active {
  display: flex;
}

.card-menu-dropdown button,
.card-menu-dropdown .menu-form button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 0.95rem;
}

.card-menu-dropdown button:hover,
.card-menu-dropdown .menu-form button:hover {
  background: #f3f4f6;
}

.app-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  background: rgba(255,255,255,0.95);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.admin-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(0,0,0,0.1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

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

.modal {
  width: 90%;
  max-width: 500px;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

/* Flash Messages */
.flash-container {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Bulk Import Modal Styles */
.import-textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.5);
  resize: vertical;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.import-textarea:focus {
  outline: none;
  background: white;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-box {
  background: #f5f3ff;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd6fe;
}

.help-box h4 {
  margin-top: 0;
  font-size: 0.95rem;
  color: #5b21b6;
  margin-bottom: 0.75rem;
}

.help-box pre {
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
  color: #4c1d95;
  overflow-x: auto;
}
