:root {
  --bg-main: #070b1a;
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-card-strong: rgba(255, 255, 255, 0.13);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --primary: #00d4ff;
  --secondary: #8b5cf6;
  --accent: #ff4ecd;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #facc15;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 30px;
  --radius-md: 18px;
}

body.light-mode {
  --bg-main: #edf4ff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-strong: rgba(255, 255, 255, 0.92);
  --text-main: #0f172a;
  --text-muted: #334155;
  --primary: #0284c7;
  --secondary: #7c3aed;
  --accent: #db2777;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 25px 70px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 212, 255, 0.22), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(255, 78, 205, 0.18), transparent 30%),
    radial-gradient(circle at 50% 95%, rgba(139, 92, 246, 0.22), transparent 35%),
    var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: 0.35s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Loader */
.loader-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050816;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.5s ease;
}

.loader-wrapper.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-card {
  text-align: center;
  color: #fff;
}

.loader-ring {
  width: 85px;
  height: 85px;
  margin: 0 auto 25px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 1s linear infinite;
}

.loader-card h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.loader-card p {
  color: #94a3b8;
}

/* Background Floating Effects */
.background-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.background-effects span {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: float 10s infinite alternate ease-in-out;
}

.background-effects span:nth-child(1) {
  background: var(--primary);
  top: 8%;
  right: 8%;
}

.background-effects span:nth-child(2) {
  background: var(--accent);
  bottom: 12%;
  left: 5%;
  animation-delay: 1.5s;
}

.background-effects span:nth-child(3) {
  background: var(--secondary);
  top: 40%;
  left: 40%;
  animation-delay: 3s;
}

.background-effects span:nth-child(4) {
  background: #22c55e;
  bottom: 5%;
  right: 35%;
  animation-delay: 4s;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 11, 26, 0.68);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

body.light-mode .site-header {
  background: rgba(255, 255, 255, 0.68);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 1.2rem;
}

.brand p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.circle-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.15rem;
  transition: 0.3s ease;
}

.circle-btn:hover {
  transform: translateY(-4px) rotate(8deg);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: var(--shadow);
}

/* Navigation */
.top-nav {
  position: sticky;
  top: 87px;
  z-index: 900;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.top-nav a {
  color: var(--text-main);
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: 0.3s;
  font-size: 0.95rem;
}

.top-nav a:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  transform: translateY(-3px);
}

/* Main */
main {
  max-width: 1220px;
  margin: auto;
  padding: 30px 18px 90px;
}

.page-section {
  display: none;
  animation: pageIn 0.6s ease;
}

.page-section.active {
  display: block;
}

/* Hero */
.hero-section {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0,212,255,0.25), transparent 70%);
  top: -120px;
  left: -120px;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--primary);
  margin-bottom: 16px;
}

.hero-content h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.35;
  margin: 0 0 12px;
}

.hero-content h2 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#typingText {
  min-height: 36px;
  color: var(--text-muted);
  font-weight: normal;
  margin-bottom: 22px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 25px 0;
}

.info-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  transition: 0.3s;
}

.info-item:hover {
  transform: translateY(-5px);
  background: var(--bg-card-strong);
}

.info-item strong {
  color: var(--primary);
}

.info-item p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.hero-buttons {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.image-glow {
  position: absolute;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: conic-gradient(var(--primary), var(--secondary), var(--accent), var(--primary));
  filter: blur(18px);
  opacity: 0.65;
  animation: spin 8s linear infinite;
}

.profile-image {
  position: relative;
  width: 270px;
  height: 270px;
  object-fit: cover;
  border-radius: 50%;
  border: 7px solid rgba(255,255,255,0.18);
  box-shadow: var(--shadow);
}

/* Cards */
.glass-card {
  margin-top: 26px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.glass-card p {
  color: var(--text-muted);
  line-height: 2.15;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title span {
  font-size: 2rem;
}

.section-title h2 {
  margin: 0 0 16px;
}

.cta-box {
  text-align: center;
  margin: 30px auto;
}

.cta-box p {
  color: var(--text-muted);
}

.primary-btn,
.secondary-btn,
.home-btn,
.to-top-btn {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 13px 22px;
  color: white;
  font-size: 1rem;
  transition: 0.32s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.18);
}

.secondary-btn {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
}

.home-btn,
.to-top-btn {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.primary-btn:hover,
.secondary-btn:hover,
.home-btn:hover,
.to-top-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow);
}

.big-btn {
  font-size: 1.08rem;
  padding: 15px 26px;
}

.thank-you {
  color: var(--primary) !important;
  margin-top: 18px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0;
}

/* Skills */
.search-card input {
  margin: 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.skill-card {
  position: relative;
  min-height: 170px;
  padding: 22px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: 0.35s ease;
  box-shadow: var(--shadow);
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: auto -40px -55px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0.15;
  transition: 0.35s;
}

.skill-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(0, 212, 255, 0.55);
}

.skill-card:hover::before {
  opacity: 0.3;
  transform: scale(1.2);
}

.skill-icon {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.skill-card h3 {
  margin: 0 0 9px;
}

.skill-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.project-card {
  padding: 20px;
  border-radius: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.35s ease;
  box-shadow: var(--shadow);
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
}

.project-preview {
  height: 190px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0,212,255,0.23), rgba(255,78,205,0.20)),
    linear-gradient(45deg, rgba(255,255,255,0.07) 25%, transparent 25%),
    #111827;
  overflow: hidden;
}

.project-preview span {
  font-size: 2rem;
  font-weight: 900;
  color: white;
  letter-spacing: 1px;
}

.project-card.large .project-preview {
  height: 260px;
}

.project-card h3 {
  margin-bottom: 6px;
}

.project-card p {
  color: var(--text-muted);
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.contact-item span {
  font-size: 1.5rem;
}

.contact-item p {
  margin: 0;
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--text-main);
  padding: 14px 15px;
  outline: none;
  font-size: 1rem;
  transition: 0.3s;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
  background: rgba(255,255,255,0.75);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

select option {
  color: #111827;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border: 1px solid var(--border);
  text-align: center;
}

th {
  background: rgba(0, 212, 255, 0.14);
  color: var(--text-main);
}

td {
  color: var(--text-muted);
}

.status-pending {
  color: var(--yellow);
  font-weight: bold;
}

.status-approved {
  color: var(--green);
  font-weight: bold;
}

.status-rejected {
  color: var(--red);
  font-weight: bold;
}

/* Admin */
.admin-note {
  color: var(--yellow) !important;
}

.admin-request {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}

.admin-request h4 {
  margin-top: 0;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.approve-btn,
.reject-btn,
.delete-btn {
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 13px;
  padding: 10px 15px;
  transition: 0.3s;
}

.approve-btn {
  background: var(--green);
}

.reject-btn {
  background: var(--red);
}

.delete-btn {
  background: #64748b;
}

.approve-btn:hover,
.reject-btn:hover,
.delete-btn:hover {
  transform: translateY(-3px);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: -370px;
  width: 350px;
  max-width: 88%;
  height: 100%;
  z-index: 3000;
  padding: 22px;
  background: rgba(7, 11, 26, 0.92);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--border);
  transition: 0.35s ease;
  box-shadow: var(--shadow);
}

.sidebar.open {
  right: 0;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}

.sidebar-top h3 {
  margin: 0;
}

.sidebar-top p {
  color: #94a3b8;
  margin: 7px 0 0;
}

.close-menu {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  width: 42px;
  height: 42px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 30px 0;
}

.sidebar-menu li {
  margin-bottom: 12px;
}

.sidebar-menu a {
  display: block;
  color: white;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  transition: 0.3s;
}

.sidebar-menu a:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: translateX(-5px);
}

.sidebar-footer {
  position: absolute;
  bottom: 20px;
  right: 22px;
  left: 22px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2500;
  display: none;
}

.overlay.active {
  display: block;
}

/* Modals */
.welcome-modal,
.skill-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}

.welcome-modal.active,
.skill-modal.active {
  display: flex;
}

.welcome-box,
.skill-modal-box {
  width: 100%;
  max-width: 540px;
  padding: 30px;
  border-radius: 28px;
  text-align: center;
  background: rgba(15, 23, 42, 0.96);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  animation: modalIn 0.45s ease;
  position: relative;
}

.welcome-icon,
.modal-icon {
  font-size: 3rem;
}

.welcome-box p,
.skill-modal-box p {
  color: #cbd5e1;
  line-height: 2;
}

.modal-close {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 6000;
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  transform: translateY(120px);
  opacity: 0;
  transition: 0.35s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 30px 16px 42px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}

.site-footer p {
  color: var(--text-muted);
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(35px, -35px) scale(1.12);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive */
@media (max-width: 1050px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-section,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero-image-wrapper {
    order: -1;
  }
}

@media (max-width: 820px) {
  .top-nav {
    top: 86px;
    overflow-x: auto;
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .top-nav a {
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .brand p {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding: 13px 15px;
  }

  .brand-icon {
    width: 45px;
    height: 45px;
    border-radius: 15px;
  }

  .brand h1 {
    font-size: 0.95rem;
  }

  .circle-btn {
    width: 42px;
    height: 42px;
  }

  main {
    padding: 20px 12px 80px;
  }

  .hero-section,
  .glass-card {
    padding: 20px;
    border-radius: 24px;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .profile-image {
    width: 220px;
    height: 220px;
  }

  .image-glow {
    width: 235px;
    height: 235px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .home-btn {
    width: 100%;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 18px;
    text-align: center;
  }
}
