/* ==========================================================================
   STYLE.CSS - Upgraded Main Portfolio Stylesheet
   Full-Stack Developer Portfolio: Slimani Djamila Nawal (TechBySDN)
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --dark: #1e293b;
  --darker: #0f172a;
  --light: #f8fafc;
  --gray: #64748b;
  --gray-light: #cbd5e1;
  --success: #10b981;
  --border-radius: 8px;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
}

/* ── FEATURE 1: SIDEBAR & LAYOUT WRAPPER ── */
#main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  width: 100%;
}

body.sidebar-closed #main-content {
  margin-left: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0f172a;
  color: #f8fafc;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

body.sidebar-closed .sidebar { transform: translateX(-100%); }

.sidebar-header { padding: 1.75rem 1.5rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.sidebar-logo-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: 1rem; font-weight: 700; color: #ffffff; line-height: 1.2; }
.sidebar-brand-title { font-size: 0.75rem; color: #94a3b8; font-weight: 500; }

.sidebar-nav { padding: 1.5rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 1.75rem; }
.sidebar-group-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; font-weight: 700; padding: 0 0.75rem 0.5rem; display: block; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #cbd5e1; font-size: 0.925rem; font-weight: 500; border-radius: var(--border-radius); transition: var(--transition); text-decoration: none; }
.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; color: #94a3b8; transition: transform 0.25s ease, color 0.25s ease; }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; padding-left: 18px; }
.sidebar-link:hover i { color: var(--primary); transform: translateX(2px); }
.sidebar-link.active { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #ffffff; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.sidebar-link.active i { color: #ffffff; }

.sidebar-footer { padding: 1.25rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 1rem; background: rgba(0, 0, 0, 0.2); margin-top: auto; }
.sidebar-socials { display: flex; align-items: center; gap: 10px; }
.sidebar-social-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 0.9rem; transition: var(--transition); text-decoration: none; }
.sidebar-social-icon:hover { background: var(--primary); color: #ffffff; transform: translateY(-2px); }
.sidebar-social-icon img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.sidebar-copyright { font-size: 0.75rem; color: #64748b; }

.sidebar-toggle-btn { position: fixed; top: 20px; left: 20px; z-index: 1100; width: 44px; height: 44px; border-radius: 10px; background: var(--darker); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: var(--transition); }
.sidebar-toggle-btn:hover { background: var(--primary); border-color: var(--primary); transform: scale(1.05); }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
body.sidebar-open-mobile .sidebar-backdrop { opacity: 1; pointer-events: auto; }

/* ── FEATURE 2: ANIMATIONS & SCROLL REVEAL ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }

.hero-load-1 { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s; opacity: 0; }
.hero-load-2 { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.25s; opacity: 0; }
.hero-load-3 { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s; opacity: 0; }
.hero-load-4 { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.55s; opacity: 0; }
.hero-load-5 { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.7s; opacity: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

h2.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
h2.section-title.is-visible::after { width: 80px; }

/* ── ORIGINAL STYLES PRESERVED VERBATIM ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
section { padding: 80px 0; }
h1, h2, h3, h4 { line-height: 1.2; margin-bottom: 1rem; font-weight: 700; }
h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; position: relative; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1.5rem; color: var(--gray); }
a { text-decoration: none; color: inherit; transition: var(--transition); }

.btn { display: inline-block; padding: 12px 28px; background: var(--primary); color: white; border-radius: var(--border-radius); font-weight: 500; border: none; cursor: pointer; transition: var(--transition); text-align: center; }
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.section-title { text-align: center; margin-bottom: 1rem; }
.section-subtitle { text-align: center; max-width: 600px; margin: 0 auto 3rem; color: var(--gray); }

header { position: fixed; top: 0; left: 0; width: 100%; z-index: 900; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); transition: var(--transition); }
.header-scrolled { padding: 10px 0; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.name-highlight { background: linear-gradient(45deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--dark); }
.logo span { color: var(--primary); }
.logo-img { height: 100px; width: auto; transition: var(--transition); }
.brand-logo { position: absolute; top: 20px; right: 20px; }
.brand-logo img { height: 50px; width: auto; opacity: 0.8; }
.profile-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.nav-links { display: flex; list-style: none; }
.nav-links li { margin-left: 2rem; }
.nav-links a { font-weight: 500; position: relative; }
.nav-links a:after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.nav-links a:hover:after, .nav-links a.active:after { width: 100%; }
.hamburger { display: none; cursor: pointer; background: none; border: none; font-size: 1.5rem; color: var(--dark); }

.hero { padding: 160px 0 100px; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); position: relative; overflow: hidden; }
.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero-text { flex: 1; }
.hero-badge { display: inline-block; padding: 6px 12px; background: rgba(37, 99, 235, 0.1); color: var(--primary); border-radius: 30px; font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; }
.hero h1 { margin-bottom: 1.5rem; font-size: 3.5rem; color: var(--darker); }
.hero p { font-size: 1.25rem; margin-bottom: 2rem; color: var(--gray); }
.hero-btns { display: flex; gap: 15px; }
.hero-image { flex: 1; text-align: center; position: relative; }
.profile-img { width: 350px; height: 350px; border-radius: 50%; object-fit: cover; border: 8px solid white; box-shadow: var(--shadow); background: linear-gradient(45deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: white; font-size: 5rem; }

.about { background: white; }
.about-content { display: flex; align-items: center; gap: 60px; }
.about-text { flex: 1; }
.about-image { flex: 1; text-align: center; }
.about-img { width: 100%; max-width: 400px; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.stats { display: flex; justify-content: space-between; margin-top: 2rem; }
.stat { text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--primary); display: block; }
.stat-text { font-size: 0.875rem; color: var(--gray); }

.skills { background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); }
.skills-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.skill-category { background: white; padding: 30px; border-radius: var(--border-radius); box-shadow: var(--shadow); transition: var(--transition); }
.skill-category:hover { transform: translateY(-5px); }
.skill-category h3 { display: flex; align-items: center; margin-bottom: 1.5rem; }
.skill-category i { margin-right: 10px; color: var(--primary); font-size: 1.5rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag { padding: 8px 16px; background: rgba(37, 99, 235, 0.1); color: var(--primary); border-radius: 30px; font-size: 0.875rem; font-weight: 500; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.project-card { background: white; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.project-card:hover { transform: translateY(-10px); }
.project-img { height: 200px; width: 100%; background: linear-gradient(45deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: white; font-size: 3rem; }
.project-content { padding: 25px; }
.project-title { font-size: 1.25rem; margin-bottom: 10px; }
.project-description { margin-bottom: 20px; font-size: 0.95rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tech-tag { padding: 5px 10px; background: rgba(37, 99, 235, 0.1); color: var(--primary); border-radius: 4px; font-size: 0.75rem; font-weight: 500; cursor: help; }
.tech-tag:hover { background-color: #2563eb; color: white; border-color: #2563eb; }
.project-links { display: flex; gap: 15px; }

.education { background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); }
.education-timeline { max-width: 800px; margin: 0 auto; position: relative; }
.education-timeline:before { content: ''; position: absolute; left: 30px; top: 0; height: 100%; width: 2px; background: var(--primary); }
.education-item { display: flex; margin-bottom: 40px; position: relative; }
.education-icon { width: 60px; height: 60px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; z-index: 1; flex-shrink: 0; margin-right: 30px; }
.education-content { background: white; padding: 25px; border-radius: var(--border-radius); box-shadow: var(--shadow); flex: 1; }
.education-year { display: inline-block; padding: 5px 15px; background: rgba(37, 99, 235, 0.1); color: var(--primary); border-radius: 30px; font-size: 0.875rem; font-weight: 500; margin-bottom: 10px; }
.education-item:last-child { margin-bottom: 0; }

.contact-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 50px; }
.contact-info { display: flex; flex-direction: column; gap: 25px; }
.contact-item { display: flex; align-items: flex-start; gap: 15px; }
.contact-icon { width: 50px; height: 50px; background: rgba(37, 99, 235, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.25rem; flex-shrink: 0; }
.contact-details h3 { margin-bottom: 5px; }
.contact-form { background: white; padding: 30px; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.form-group { margin-bottom: 20px; }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--gray-light); border-radius: var(--border-radius); font-family: inherit; font-size: 1rem; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
textarea.form-control { min-height: 150px; resize: vertical; }

footer { background: var(--darker); color: white; padding: 60px 0 30px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.footer-logo { font-size: 1.5rem; font-weight: 700; }
.footer-logo span { color: var(--primary); }
.footer-logo-img { height: 45px; width: auto; filter: brightness(0) invert(1); }
.social-links { display: flex; gap: 15px; }
.social-link { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.social-link:hover { background: var(--primary); transform: translateY(-3px); }
.social-icon-img { width: 20px; height: 20px; object-fit: contain; filter: brightness(0) invert(1); }
.copyright { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: var(--gray-light); font-size: 0.875rem; }

/* Responsive Design */
@media (max-width: 992px) {
  h1 { font-size: 2.8rem; }
  h2 { font-size: 2.2rem; }
  .hero-content, .about-content { flex-direction: column; }
  .hero-text, .about-text { text-align: center; }
  .hero-btns { justify-content: center; }
  .stats { justify-content: space-around; }
}

@media (max-width: 900px) {
  #main-content { margin-left: 0 !important; }
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open-mobile .sidebar { transform: translateX(0); box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5); }
}

@media (max-width: 768px) {
  .navbar { padding: 15px 0; }
  .nav-links {
    position: fixed; top: 70px; left: 0; width: 100%; background: white;
    flex-direction: column; align-items: center; padding: 20px 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); transform: translateY(-150%); transition: var(--transition);
  }
  .nav-links.active { transform: translateY(0); }
  .nav-links li { margin: 10px 0; }
  .hamburger { display: block; }
  .profile-img { width: 280px; height: 280px; }
  .footer-content { flex-direction: column; gap: 30px; text-align: center; }
  .logo-img { height: 35px; }
}

@media (max-width: 576px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  section { padding: 60px 0; }
  .hero { padding: 130px 0 80px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 250px; }
  .projects-grid { grid-template-columns: 1fr; }
  .profile-img { width: 220px; height: 220px; }
  .stats { flex-direction: column; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  h2.section-title::after { width: 80px !important; }
}