/* --- Font Definitions --- */
/* SF Pro Display - Regular (Normal Style) */
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYREGULAR.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* SF Pro Display - Medium (Normal Style) */
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYMEDIUM.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* SF Pro Display - Bold (Normal Style) */
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYBOLD.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* SF Pro Display - Semibold (Normal Style) */
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYSEMIBOLDITALIC.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Theme Variables --- */
:root {
    /* Light Mode Defaults (iOS Blue Accents) */
    --bg-color: #f2f2f7; /* iOS System Gray 6 */
    --text-color: #1d1d1f;
    --heading-color: #000000;
    --heading-alt-color: #333333;
    --link-color: #007AFF; /* iOS Blue */
    --link-hover-color: #006adc;
    --border-color: #d1d1d6; /* iOS System Gray 4 */
    --border-dashed-color: #d1d1d6;
    --card-bg-color: #ffffff;
    --cv-button-bg-color: #007AFF;
    --cv-button-text-color: #ffffff;
    --cv-button-hover-bg-color: #006adc;
    --icon-color: #555;
    --icon-hover-color: #007AFF;
    --footer-bg-color: #0a0a0a;
    --footer-text-color: #cecece; /* iOS System Gray */
    --shadow-color: rgba(0,0,0,0.1);
    --heart-color: #d43f57;
    --aside-text-color: #555;
    --pane-radius: 12px;

    /* iOS-style Tab Variables (Light Mode) */
    --tab-container-bg: #e9e9eb; /* iOS System Gray 5 */
    --tab-container-border: transparent;
    --tab-inactive-text: #3c3c4399; /* Opacity for inactive text */
    --tab-inactive-hover-bg: #dfdfdf;
    --tab-active-bg: #ffffff;
    --tab-active-text: #006adc;
    --tab-active-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.08);
    
    /* Toast Variables (Light Mode) */
    --toast-bg: #333;
    --toast-text-color: #fff;
    --toast-shadow: 0 4px 12px rgba(0,0,0,0.2);

    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Dark Mode Overrides (iOS Inspired) --- */
body.dark-mode {
    --bg-color: #000000;
    --text-color: rgba(235, 235, 245, 0.85);
    --heading-color: #ffffff;
    --heading-alt-color: #f2f2f7;
    --link-color: #0A84FF; /* iOS Dark Mode Blue */
    --link-hover-color: #3f9fff;
    --border-color: #38383a; /* iOS Dark System Gray 4 */
    --border-dashed-color: #38383a;
    --card-bg-color: #1c1c1e; /* iOS Dark System Gray 6 */
    --cv-button-bg-color: #0A84FF;
    --cv-button-text-color: #ffffff;
    --cv-button-hover-bg-color: #3f9fff;
    --icon-color: #8d8d92;
    --icon-hover-color: #0A84FF;
    --footer-bg-color: #1c1c1e;
    --footer-text-color: #8d8d92;
    --shadow-color: rgba(255, 255, 255, 0.05);
    --heart-color: #f87171;
    --aside-text-color: #8d8d92;

    /* iOS-style Tab Variables (Dark Mode) */
    --tab-container-bg: #2c2c2e; /* iOS Dark System Gray 5 */
    --tab-inactive-text: rgba(235, 235, 245, 0.6);
    --tab-inactive-hover-bg: #3a3a3c;
    --tab-active-bg: #0A84FF;
    --tab-active-text: #ffffff;
    --tab-active-shadow: 0 1px 2px rgba(0,0,0,0.3);

    /* Toast Variables (Dark Mode) */
    --toast-bg: #f2f2f7; /* Light background for contrast */
    --toast-text-color: #1d1d1f; /* Dark text */
    --toast-shadow: 0 4px 12px rgba(0,0,0,0.4);
}


/* --- Basic Reset & Defaults --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--theme-transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1600px;
  width: 95%;
  margin: 20px auto;
  padding: 0;
  flex-grow: 1;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-hover-color);
}

h1, h2, h3 {
  margin-bottom: 0.8em;
  color: var(--heading-color);
  transition: var(--theme-transition);
  font-weight: 700;
}

h1 { font-size: 2.5em; margin-bottom: 0.4em; }
h2 { font-size: 1.8em; border-bottom: 2px solid var(--border-dashed-color); padding-bottom: 0.3em; margin-top: 1em; }
h3 { font-size: 1.3em; color: var(--heading-alt-color); }
p { margin-bottom: 1em; }
ul { list-style-position: inside; margin-left: 1em; margin-bottom: 1em; }
li { margin-bottom: 0.5em; }

/* --- Copy to Clipboard Styles --- */
.copy-email-link {
    cursor: pointer;
}
.profile-aside .copy-email-link:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    color: var(--link-color);
}


/* --- Header --- */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.profile-picture { flex-shrink: 0; }
.profile-picture img {
  display: block;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: border-color 0.3s ease;
}

.profile-main { flex-grow: 1; text-align: center; }
.profile-main h1 { margin-bottom: 10px; }

.contact-info {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px 20px;
  font-size: 1.5em;
}
.profile-main .contact-info:last-of-type { margin-top: 15px; }
.cv-button-row { gap: 0; }

.contact-info a:not(.cv-download-button) {
  color: var(--icon-color);
  transition: color 0.3s ease;
}
.contact-info a:not(.cv-download-button):hover { color: var(--icon-hover-color); }

/* --- iOS Themed Download Button --- */
.cv-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 0.9em;
  font-weight: 500;
  background-color: var(--cv-button-bg-color);
  color: var(--cv-button-text-color);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  line-height: 1.4;
}

.cv-download-button:hover {
  background-color: var(--cv-button-hover-bg-color);
  color: var(--cv-button-text-color);
}
.cv-download-button:active { transform: scale(0.97); }

.profile-aside {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.9em;
  color: var(--aside-text-color);
  transition: color 0.3s ease;
  min-width: 150px;
}
.profile-aside p { margin-bottom: 0.3em; }
.profile-aside i { margin-right: 5px; width: 1.2em; text-align: center; }


/* --- Theme Toggle Button --- */
.theme-toggle-button {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    color: var(--heading-color);
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    transition: var(--theme-transition), transform 0.1s ease, border-color 0.3s ease;
    position: fixed;
    z-index: 1000;
    top: 25px;
    right: 25px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.theme-toggle-button:hover { background-color: var(--tab-inactive-hover-bg); border-color: var(--heading-alt-color); }
.theme-toggle-button:active { transform: scale(0.95); }


/* --- Tabs (iOS Segmented Control Style) --- */
.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 25px auto;
  background-color: var(--tab-container-bg);
  border-radius: 9px;
  padding: 3px;
  border: 1px solid var(--tab-container-border);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: var(--theme-transition);
}

.tab-link {
  font-family: 'SF Pro Display', sans-serif;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 6px 16px;
  margin: 0;
  font-size: 0.9em;
  font-weight: 500;
  color: var(--tab-inactive-text);
  background-color: transparent;
  border-radius: 7px;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  line-height: 1.5;
  white-space: nowrap;
}

.tab-link:not(.active):hover {
  background-color: var(--tab-inactive-hover-bg);
  color: var(--tab-active-text);
}

.tab-link.active {
  background-color: var(--tab-active-bg);
  color: var(--tab-active-text);
  font-weight: 600;
  box-shadow: var(--tab-active-shadow);
  animation: tab-pop 0.3s ease-out;
}


/* --- Tab Content --- */
.tab-pane {
  display: none;
  padding: 25px 40px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg-color);
  border-radius: var(--pane-radius);
  clear: both;
  transition: var(--theme-transition);
}

.tab-pane.active { display: block; animation: fadeIn 0.5s; }
.content-item { margin-bottom: 2em; padding-bottom: 1.5em; border-bottom: 1px dashed var(--border-dashed-color); transition: border-color 0.3s ease; }
.content-item:last-child { border-bottom: none; margin-bottom: 0; }
.content-item .date { font-style: italic; color: var(--icon-color); font-size: 0.9em; margin-bottom: 0.5em; transition: color 0.3s ease; }


/* --- Other Sections --- */
.technical-skills-list { margin-bottom: 2em; padding-bottom: 1.5em; border-bottom: 1px dashed var(--border-dashed-color); }
.technical-skills-list dl { display: grid; grid-template-columns: auto 1fr; gap: 0.5em 1.5em; list-style: none; margin-left: 0; }
.technical-skills-list dt { font-weight: 700; color: var(--heading-alt-color); white-space: nowrap; position: relative; padding-right: 0.5em; }
.technical-skills-list dt::after { content: ":"; position: absolute; right: 0; }
.technical-skills-list dd { margin-left: 0; color: var(--text-color); }

.project-item { display: flex; align-items: flex-start; gap: 25px; }
.project-image { width: 250px; height: auto; border-radius: 4px; box-shadow: 0 2px 5px var(--shadow-color); object-fit: cover; flex-shrink: 0; transition: box-shadow 0.3s ease; }
.project-details { flex: 1; }
.project-details h3 { margin-top: 0; margin-bottom: 0.5em; }
.project-links a { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.project-links i { font-size: 0.9em; }

/* --- Certification Section Specific Styles --- */
.certification-item { display: flex; align-items: flex-start; gap: 25px; }
.certification-image { width: 200px; height: auto; border-radius: 4px; box-shadow: 0 2px 5px var(--shadow-color); object-fit: contain; flex-shrink: 0; transition: box-shadow 0.3s ease; background-color: var(--card-bg-color); }
.certification-details { flex: 1; }
.certification-details h3 { margin-top: 0; margin-bottom: 0.5em; }
.certification-details p:last-child { margin-top: 0.5em; margin-bottom: 0; font-size: 0.9em; }

/* --- Education Section Specific Styles --- */
.education-item {
  display: flex;
  align-items: center;
  gap: 25px;
}

.education-logo img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  background-color: #fff;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
}

.education-details { flex: 1; }
.education-details h3, .education-details p { margin-bottom: 0.25em; }


/* --- Footer --- */
.site-footer {
  background-color: var(--footer-bg-color);
  color: var(--footer-text-color);
  text-align: center;
  padding: 40px 0;
  margin-top: 40px;
  font-size: 0.9em;
  transition: var(--theme-transition);
  border-top: 1px solid var(--border-color);
}
.site-footer p { margin-bottom: 5px; }
.site-footer i.fa-heart { color: var(--heart-color); transition: color 0.3s ease; }

/* --- Toast Notification --- */
#toast-notification {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 250px;
    background-color: var(--toast-bg);
    color: var(--toast-text-color);
    box-shadow: var(--toast-shadow);
    text-align: center;
    border-radius: 8px;
    padding: 14px 20px;
    z-index: 1001; /* Higher than theme toggle */
    font-family: 'SF Pro Display', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#toast-notification.show {
    visibility: visible;
    opacity: 1;
    bottom: 40px; /* Animate upwards */
}


/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tab-pop { 0% { transform: scale(0.96); } 80% { transform: scale(1.02); } 100% { transform: scale(1); } }


/* --- Responsiveness (Desktop/Tablet) --- */
@media (max-width: 1024px) {
    .profile-picture img { width: 100px; height: 100px; }
    h1 { font-size: 2.2em; }
    .profile-aside { font-size: 0.85em; min-width: 130px;}
}

/* =========================================
   MOBILE UI CUSTOMIZATIONS (Max Width 768px)
   ========================================= */

/* Default: Hide Mobile UI elements on Desktop */
#mobile-ui-container {
    display: none;
}

@media (max-width: 768px) {
  /* 1. Hide Desktop Elements */
  .desktop-tabs { display: none !important; }

  /* 2. Show Mobile UI */
  #mobile-ui-container { display: block; }

  /* 3. Adjust Main Layout */
  .container { width: 90%; padding-bottom: 120px; /* Space for floating nav */ }
  .profile-header { flex-direction: column; padding: 20px 0; gap: 15px; }
  .profile-picture { order: -1; }
  .profile-picture img { width: 100px; height: 100px; }
  .profile-main { order: 0; }
  .profile-aside { order: 1; text-align: center; min-width: auto; margin-top: 10px; }
  .profile-aside p { margin-bottom: 0.5em; }

  h1 { font-size: 2em; }
  h2 { font-size: 1.5em; }
  .contact-info { font-size: 1.3em; gap: 10px 15px; }
  .cv-button-row { margin-top: 10px; }
  .cv-download-button { padding: 10px 15px; }
  .theme-toggle-button { top: 15px; right: 15px; font-size: 1.1em; width: 35px; height: 35px; }

  .tab-pane { margin-top: 0; padding: 20px 15px; }

  /* Stack content items vertically on mobile */
  .project-item, .certification-item, .education-item { flex-direction: column; align-items: flex-start; text-align: left; gap: 15px; }
  .project-image { width: 80%; max-width: 350px; margin-bottom: 10px; }
  .certification-image { width: 60%; max-width: 250px; margin-bottom: 10px; }
  .project-details, .certification-details { width: 100%; }
  .project-links { text-align: center; margin-top: 1em; }
  .certification-details ul, .education-details ul { text-align: left; display: inline-block; }
  .certification-details p:last-child { text-align: center; }
  
  .technical-skills-list dl { grid-template-columns: 1fr; gap: 0.2em 0; }
  .technical-skills-list dt { text-align: left; padding-right: 0; }
  .technical-skills-list dt::after { content: ":"; }
  .technical-skills-list dd { text-align: left; margin-bottom: 0.8em; }

  /* --- Floating Arrows (Left & Right) --- */
  .nav-arrow {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255, 255, 255, 0.7);
      border-radius: 50%;
      border: 1px solid var(--border-color);
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      color: #007AFF; /* Orange color */
      cursor: pointer;
      z-index: 900;
      backdrop-filter: blur(5px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
      transition: all 0.2s;
  }
  body.dark-mode .nav-arrow { background: rgba(30, 30, 30, 0.7); }
  
  .nav-arrow:hover { transform: translateY(-50%) scale(1.1); background: var(--card-bg-color); }
  .nav-arrow:active { transform: translateY(-50%) scale(0.9); }
  .nav-arrow-left { left: 10px; }
  .nav-arrow-right { right: 10px; }

  /* --- Bottom Area Wrapper --- */
  .mobile-bottom-controls {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      z-index: 1000;
      pointer-events: none; /* Allow clicking through empty areas */
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding-bottom: 15px; /* Bottom spacing for the capsule */
  }

  /* --- Floating Buttons Area (Above Capsule) --- */
  .floating-action-buttons {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      padding: 0 15px 10px 15px; /* Spacing between FABs and Capsule */
      pointer-events: none;
  }

  .fab-btn {
      pointer-events: auto;
      background-color: var(--card-bg-color);
      color: var(--text-color);
      border: 1px solid var(--border-color);
      box-shadow: 0 4px 10px rgba(0,0,0,0.2);
      border-radius: 50px;
      padding: 8px 16px;
      font-family: 'SF Pro Display', sans-serif;
      font-weight: 600;
      font-size: 0.9rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: transform 0.2s;
  }
  .fab-btn:active { transform: scale(0.95); }

  .fab-top {
      width: 45px;
      height: 45px;
      border-radius: 50%;
      justify-content: center;
      padding: 0;
      background-color: var(--link-color);
      color: white;
      border: none;
  }

  .fab-wrapper { position: relative; pointer-events: auto; }

  .contact-options {
      position: absolute;
      bottom: 55px;
      left: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
      opacity: 0;
      visibility: hidden;
      transform: translateY(20px);
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  .contact-options.show { opacity: 1; visibility: visible; transform: translateY(0); }

  .mini-fab {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background-color: var(--card-bg-color);
      color: var(--icon-color);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
      font-size: 1.2rem;
      border: 1px solid var(--border-color);
      transition: color 0.2s, background-color 0.2s;
  }
  .mini-fab:nth-child(1):hover { background: #0077b5; border-color: #0077b5; color: white; }
  .mini-fab:nth-child(2):hover { background: #333; border-color: #333; color: white; }
  .mini-fab:nth-child(3):hover { background: #4285F4; border-color: #4285F4; color: white; }
  .mini-fab:nth-child(4):hover { background: #EA4335; border-color: #EA4335; color: white; }

  /* --- FLOATING CAPSULE NAVIGATION (Single Row) --- */
  .glass-nav-bar {
      pointer-events: auto;
      margin: 0 15px; /* Left/Right margin to make it float */
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-radius: 20px; /* Capsule shape */
      padding: 5px;
      box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  }
  body.dark-mode .glass-nav-bar {
      background: rgba(28, 28, 30, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .glass-nav-single-row {
      display: grid;
      grid-template-columns: repeat(6, 1fr); /* 6 Equal Columns */
      gap: 2px;
  }

  .glass-tab-link {
      background: transparent;
      border: none;
      color: var(--text-color);
      opacity: 0.6;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 6px 0;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
  }
  
  /* Compact Icon & Text sizes for 6 items in one row */
  .glass-tab-link i { font-size: 16px; margin-bottom: 3px; }
  .glass-tab-link span { font-size: 9px; font-weight: 600; letter-spacing: -0.2px; }

  .glass-tab-link.active {
      background-color: var(--tab-active-bg);
      color: var(--tab-active-text);
      opacity: 1;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
}

@media (max-width: 480px) {
  .container { width: 95%; }
  .profile-picture img { width: 80px; height: 80px; }
  h1 { font-size: 1.8em; }
  .contact-info { font-size: 1.2em; gap: 8px 12px;}
  .cv-download-button { font-size: 0.8em; }
  .theme-toggle-button { top: 10px; right: 10px; }
  .tab-link { font-size: 0.85em; }
  .project-image { width: 95%; }
  .certification-image { width: 80%; max-width: 200px; }
  .project-links a { margin-right: 5px; }
}


/* =========================================
   FOOTER PARTICLES & MOBILE HEIGHT TWEAKS
   ========================================= */

.site-footer {
    position: relative; /* Essential for containing the canvas */
    overflow: hidden;   /* Prevents scrollbars if particles go off-edge */
    z-index: 1;
}

/* Canvas Styling */
#footer-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind text */
    pointer-events: none; /* Allow clicking through to footer content if needed */
}

/* Ensure text sits on top of particles */
.footer-content {
    position: relative;
    z-index: 2;
}

/* --- Mobile Specific Adjustments --- */
@media (max-width: 768px) {
    .site-footer {
        /* Goal 1: Increase height significantly on mobile */
        padding-bottom: 100px !important; /* Extra space for Floating Nav */
        padding-top: 60px;
        min-height: 200px; /* Force it to be taller so particles are visible */
        display: flex;
        flex-direction: column;
        justify-content: center; /* Center text vertically in the new space */
    }
}