/* ==========================================================================
   PORTFOLIO BASE & THEME DEFINITIONS
   ========================================================================== */
:root {
  /* Dark Theme (Default) */
  --bg-base: #0a0b10;
  --bg-surface: rgba(18, 20, 32, 0.75);
  --bg-surface-opaque: #121420;
  --bg-panel: #161827;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-rgb: 99, 102, 241;
  --primary-light: rgba(99, 102, 241, 0.12);
  --secondary: #ec4899;
  --accent-glow: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* Light Theme */
  --bg-base: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.8);
  --bg-surface-opaque: #ffffff;
  --bg-panel: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(79, 70, 229, 0.5);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #3730a3;
  --primary-rgb: 79, 70, 229;
  --primary-light: rgba(79, 70, 229, 0.08);
  --secondary: #db2777;
  --accent-glow: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 60%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
}

/* Reset & Core Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-main);
  transition: background-color 0.5s ease, color 0.3s ease;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.portfolio-view {
  width: 100%;
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
}

p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Button & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--bg-surface-opaque);
  color: var(--text-main);
  border-color: var(--border);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--text-muted);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border);
}

/* Glassmorphism Card styling */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(var(--bg-base), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem;
}

.nav-link:hover {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle button */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background-color: var(--bg-surface-opaque);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  transform: scale(1.05);
}

/* Dynamic Sections structure */
section {
  padding: 6rem 0;
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
}

/* Hero Section style */
.hero-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title-greeting {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-bio {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.hero-bio p {
  color: var(--text-main);
}

.hero-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-avatar {
  width: clamp(220px, 25vw, 320px);
  height: clamp(220px, 25vw, 320px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-surface-opaque);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  z-index: 2;
}

.hero-avatar-ring {
  position: absolute;
  width: calc(clamp(220px, 25vw, 320px) + 20px);
  height: calc(clamp(220px, 25vw, 320px) + 20px);
  border-radius: 50%;
  border: 2px dashed var(--primary);
  opacity: 0.4;
  animation: spin 60s linear infinite;
  z-index: 1;
}

/* Skills Section styles */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.skill-icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  color: var(--primary);
  flex-shrink: 0;
}

.skill-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.skill-info {
  flex-grow: 1;
  min-width: 0;
}

.skill-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
}

.skill-level {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Certificates Section styles */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.cert-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.cert-img-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-base);
  position: relative;
  cursor: pointer;
}

.cert-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cert-card:hover .cert-img {
  transform: scale(1.05);
}

.cert-body {
  padding: 1.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cert-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.cert-issuer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.cert-date {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

/* Projects Section styles */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

.project-img-box {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: var(--bg-panel);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

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

.project-desc p {
  color: var(--text-muted);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

/* Contact Section styles */
.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-details p {
  margin-bottom: 0;
  color: var(--text-main);
  font-weight: 500;
}

.contact-info-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.contact-social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.social-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  background-color: var(--primary-light);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Custom Sections styles */
.custom-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.custom-block-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.custom-block-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--bg-panel);
}

.custom-block-content {
  padding: 1.75rem;
}

.custom-block-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Floating settings shortcut */
.floating-key {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px dashed transparent;
  cursor: pointer;
  z-index: 99;
  opacity: 0.1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.floating-key:hover {
  opacity: 0.8;
  border-color: var(--border);
  background: var(--bg-surface-opaque);
  box-shadow: var(--shadow-sm);
}

/* Footer layout */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  background: var(--bg-surface-opaque);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Responsive constraints */
@media (max-width: 991px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-avatar-wrapper {
    order: -1;
  }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  section {
    padding: 4rem 0;
  }
}
