/* Custom Styles for Tamim Hasan - Premium Dark Portfolio */

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

:root {
  --color-bg: #070a0f;
  --color-card-bg: rgba(17, 24, 39, 0.7);
  --color-cyan-glow: rgba(6, 182, 212, 0.4);
  --color-teal-glow: rgba(20, 184, 166, 0.4);
}

html {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--color-bg);
  width: 100% !important;
  max-width: 100% !important;
}

/* Header Behavior: Permanent Frozen Pinned on PC (>=768px) with 80px Top Offset, Relative on Mobile (<768px) */
@media (min-width: 768px) {
  body:not(.admin-mode) header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, padding 0.3s ease !important;
  }

  body:not(.admin-mode) main,
  body:not(.admin-mode) #dashboard-view,
  body:not(.admin-mode) #login-overlay {
    padding-top: 80px !important;
  }
}

@media (max-width: 767px) {
  body:not(.admin-mode) header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: 99 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease !important;
  }

  body:not(.admin-mode) main,
  body:not(.admin-mode) #dashboard-view,
  body:not(.admin-mode) #login-overlay {
    padding-top: 0 !important;
  }
}

/* Dedicated Admin Mode Clean Reset */
body.admin-mode,
body.admin-mode #dashboard-view,
body.admin-mode #login-view {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.admin-mode header,
body.admin-mode #admin-topbar {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Strict mobile horizontal scroll leak prevention */
body * {
  max-width: 100vw;
}

@media (max-width: 768px) {
  .bg-glow-aura, .bg-glow-aura-teal {
    display: none !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #070a0f;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #06b6d4;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.15);
  transform: translateY(-4px);
}

/* Floating Aura Backgrounds */
.bg-glow-aura {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-cyan-glow) 0%, rgba(6, 182, 212, 0) 70%);
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-aura-teal {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-teal-glow) 0%, rgba(20, 184, 166, 0) 70%);
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Animation Keyframes */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes float-reverse {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(8px) rotate(-1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* Float Helpers */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-reverse 7s ease-in-out infinite;
  animation-delay: 1.5s;
}

.animate-pulse-slow {
  animation: pulse-slow 8s ease-in-out infinite;
}

/* Glowing Elements */
.glow-text-cyan {
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.glow-btn-primary {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.glow-btn-primary:hover {
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
  transform: translateY(-2px);
}

.glow-btn-outline {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glow-btn-outline:hover {
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
  border-color: #22d3ee;
  color: #22d3ee;
}

/* Dynamic Hover Effect for Cards (via JS mouse coordinates) */
.glow-card-hover {
  position: relative;
}

.glow-card-hover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(
    800px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
    rgba(6, 182, 212, 0.08),
    transparent 40%
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.glow-card-hover:hover::before {
  opacity: 1;
}

/* Disabled scroll reveal to ensure 100% visibility on load */
.reveal, .reveal-left, .reveal-right {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.reveal-delay-1, .reveal-delay-2, .reveal-delay-3 {
  transition-delay: 0s !important;
}

/* Sidebar Dashboard Styles */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
  border-left-color: rgba(6, 182, 212, 0.3);
}

.sidebar-link.active {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.05);
  border-left-color: #06b6d4;
  font-weight: 600;
}

/* Dynamic Admin Scroll Container */
.custom-scrollbar-thin::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.custom-scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.custom-scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #06b6d4;
}

/* Drawer slide-in animations */
#details-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}
#details-drawer.active {
  transform: translateX(0) !important;
  display: flex !important;
}
#drawer-backdrop.active {
  display: block !important;
}

/* Sidebar Collapse Transition Rules */
aside {
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
}
aside.collapsed {
  width: 5rem !important; /* Icon-only view (80px) */
}
aside.collapsed .sidebar-link span {
  display: none !important;
}
aside.collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-left-width: 4px;
}
aside.collapsed .sidebar-text {
  display: none !important;
}
aside.collapsed .sidebar-icon-collapsed {
  display: flex !important;
}
aside.collapsed .border-t span {
  display: none !important;
}
aside.collapsed #logout-btn {
  font-size: 9px;
  padding: 6px 0;
}

/* Line Clamp Utility */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Module Builder Row Animation */
.module-row {
  animation: moduleSlideIn 0.25s ease;
}
@keyframes moduleSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Premium Dashboard Animations */
.animate-pulse-subtle {
  animation: pulseSubtle 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseSubtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Select Dropdown Styling Overrides for Premium Dark Mode */
select {
  background-color: #05070c !important;
  color: #d1d5db !important;
  border: 1px solid #1e293b !important;
}

/* Mobile Menu Backdrop Fix (No Text Bleed-through) */
#mobile-menu {
  background-color: #0b1120 !important;
  background: rgba(11, 17, 32, 0.98) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95) !important;
  z-index: 999 !important;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2) !important;
}

select option {
  background-color: #05070c !important;
  color: #d1d5db !important;
}

select:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25) !important;
}

