/* =====================================================
   André Dev — Global Styles
   andredev.pt
   ===================================================== */

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* =====================================================
   LIGHT MODE
   ===================================================== */
html.light body {
  background-color: #f8fafc;
  color: #0f172a;
}
html.light #navbar.scrolled {
  background: rgba(248, 250, 252, 0.95);
  border-bottom-color: rgba(0,0,0,0.07);
}
html.light .glass-card {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.08);
}
html.light .input-field {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
html.light .input-field::placeholder { color: #94a3b8; }
html.light .input-field:focus {
  border-color: rgba(99,102,241,0.5);
  background: #fff;
}
html.light .btn-ghost {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #374151;
}
html.light .btn-ghost:hover {
  background: rgba(0,0,0,0.08);
  color: #111827;
}
html.light .tag {
  background: rgba(99,102,241,0.08);
  color: #6366f1;
  border-color: rgba(99,102,241,0.15);
}
html.light .service-card,
html.light .portfolio-card,
html.light .testimonial-card,
html.light .pricing-card,
html.light .project-card,
html.light .stat-card {
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(0,0,0,0.07) !important;
}
html.light .project-card:hover {
  border-color: rgba(99,102,241,0.25) !important;
}
html.light .dash-tab.active-tab {
  background: rgba(99,102,241,0.1);
}
html.light footer {
  border-top-color: rgba(0,0,0,0.07) !important;
}

/* =====================================================
   SCROLL REVEAL ANIMATIONS
   ===================================================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.scroll-visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-reveal[data-delay="100"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="200"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="300"] { transition-delay: 0.3s; }
.scroll-reveal[data-delay="400"] { transition-delay: 0.4s; }
.scroll-reveal[data-delay="500"] { transition-delay: 0.5s; }

body {
  background-color: #030712;
  color: #f9fafb;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ---- Selection ---- */
::selection { background: rgba(99, 102, 241, 0.3); color: #e0e7ff; }

/* =====================================================
   NAVBAR
   ===================================================== */
#navbar {
  background: rgba(3, 7, 18, 0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}
#navbar.scrolled {
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 20px rgba(0,0,0,0.4);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  background-size: 200% 200%;
  background-position: 0% 50%;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
  background-position: 100% 50%;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background: rgba(255,255,255,0.04);
  color: #d1d5db;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  transform: translateY(-1px);
}

/* =====================================================
   INPUTS
   ===================================================== */
.input-field {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.2s ease;
  width: 100%;
  outline: none;
}
.input-field::placeholder { color: #6b7280; }
.input-field:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(17, 24, 39, 1);
}
.input-field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   GLASS CARD
   ===================================================== */
.glass-card {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* =====================================================
   GRADIENT TEXT
   ===================================================== */
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =====================================================
   TAGS / BADGES
   ===================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  letter-spacing: 0.025em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}
.status-badge.pending    { background: rgba(234, 179, 8, 0.1);  color: #fbbf24; border: 1px solid rgba(234,179,8,0.2); }
.status-badge.in_progress { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.status-badge.completed  { background: rgba(34, 197, 94, 0.1);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.status-badge.cancelled  { background: rgba(239, 68, 68, 0.1);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.status-badge.proposal   { background: rgba(168, 85, 247, 0.1); color: #c084fc; border: 1px solid rgba(168,85,247,0.2); }

/* =====================================================
   GRID PATTERN BACKGROUND
   ===================================================== */
.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* =====================================================
   PAGE SYSTEM (SPA)
   ===================================================== */
.page { display: none; }
.page.active { display: block; }
.page.hidden { display: none; }

/* =====================================================
   DASHBOARD NAV TABS
   ===================================================== */
.dash-tab {
  padding: 0.4rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.dash-tab:hover { color: #d1d5db; background: rgba(255,255,255,0.04); }
.dash-tab.active-tab {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
}

/* =====================================================
   FILTER BUTTONS
   ===================================================== */
.filter-btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.filter-btn:hover { color: #d1d5db; border-color: rgba(255,255,255,0.12); }
.filter-btn.active-filter {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  font-weight: 600;
}

/* =====================================================
   PROJECT CARD
   ===================================================== */
.project-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.25s ease;
  cursor: pointer;
}
.project-card:hover {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

/* =====================================================
   STAT CARD
   ===================================================== */
.stat-card {
  transition: all 0.2s ease;
}
.stat-card:hover {
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* =====================================================
   SERVICE CARD ENHANCEMENTS
   ===================================================== */
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.03), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.service-card { position: relative; }
.service-card:hover::before { opacity: 1; }

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  max-width: 360px;
  animation: toastIn 0.3s ease forwards;
  font-size: 0.8rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.toast.toast-success { border-color: rgba(34, 197, 94, 0.2); }
.toast.toast-error   { border-color: rgba(239, 68, 68, 0.2); }
.toast.toast-info    { border-color: rgba(59, 130, 246, 0.2); }
.toast.toast-warning { border-color: rgba(234, 179, 8, 0.2); }
.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.toast-message { color: #e5e7eb; flex: 1; }
.toast-title { font-weight: 600; color: #f9fafb; margin-bottom: 0.1rem; }
.toast-close {
  flex-shrink: 0;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.toast-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* =====================================================
   MODAL
   ===================================================== */
#newProjectModal .glass-card {
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(255,255,255,0.08);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.animate-fade-up  { animation: fadeUp  0.6s ease forwards; }
.animate-fade-in  { animation: fadeIn  0.4s ease forwards; }
.animate-float    { animation: float   6s ease-in-out infinite; }

/* =====================================================
   RESPONSIVE HELPERS
   ===================================================== */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }

  .stat-card { padding: 1rem; }
  
  .btn-primary, .btn-ghost {
    width: 100%;
  }
}

/* =====================================================
   SCROLLBAR IN MODALS / LISTS
   ===================================================== */
.overflow-y-auto::-webkit-scrollbar { width: 4px; }
.overflow-y-auto::-webkit-scrollbar-track { background: transparent; }
.overflow-y-auto::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* =====================================================
   ADMIN SPECIFIC
   ===================================================== */
.admin-content { min-height: calc(100vh - 4rem); }

.admin-table-row {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(255,255,255,0.04);
  gap: 1rem;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}
.admin-table-row:hover {
  background: rgba(31, 41, 55, 0.7);
  border-color: rgba(255,255,255,0.08);
}

/* =====================================================
   PORTFOLIO CARD
   ===================================================== */
.portfolio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* =====================================================
   TESTIMONIAL
   ===================================================== */
.testimonial-card {
  transition: all 0.25s ease;
}
.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* =====================================================
   DASH CONTENT — mobile tab visibility
   ===================================================== */
.dash-content { min-height: calc(100vh - 4rem); }
.admin-content { min-height: calc(100vh - 4rem); }

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner {
  display: inline-block;
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   PROJECT DETAIL TABS
   ===================================================== */
.proj-tab {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 0.5rem 0.5rem 0 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.proj-tab:hover { color: #d1d5db; }
.proj-tab.active-ptab {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

/* =====================================================
   PRICING CARD
   ===================================================== */
.pricing-card {
  transition: all 0.3s ease;
}

/* =====================================================
   FAQ
   ===================================================== */
.faq-item button:hover {
  background: rgba(255,255,255,0.02);
}

/* =====================================================
   CHAT MESSAGES — line clamp
   ===================================================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================
   NOTIFICATION DOT PULSE
   ===================================================== */
#notifBadge {
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width 0.5s ease;
}

/* =====================================================
   FORM GROUPS
   ===================================================== */
.form-group { position: relative; }
.form-group .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #4b5563;
  font-size: 0.8rem;
  pointer-events: none;
}
.form-group .input-field { padding-left: 2.5rem; }

/* =====================================================
   LINK UNDERLINE STYLE
   ===================================================== */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 9999px;
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }
