
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f4f4;
  color: #333;
}

.resume-container {
  display: flex;
  max-width: 1200px;
  margin: 40px auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  background: white;
}

.sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
  background: #004080;
  color: white;
  padding: 30px;
  width: 30%;
  box-sizing: border-box;
}

.sidebar h1 {
  font-size: 26px;
  margin-bottom: 5px;
}

.sidebar h3 {
  font-weight: normal;
  margin-top: 0;
}

.sidebar a {
  color: #aad8ff;
  text-decoration: none;
}

.sidebar ul {
  padding-left: 20px;
}

.sidebar .profile-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 3px solid #fff;
}

.main-content {
  width: 70%;
  padding: 30px;
  box-sizing: border-box;
}

main h2 {
  color: #004080;
  margin-top: 0;
  border-bottom: 2px solid #ccc;
  padding-bottom: 5px;
}

main h3 {
  margin-bottom: 5px;
  margin-top: 25px;
}

main ul {
  padding-left: 20px;
}

.sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
  text-align: center;
}

.sidebar .profile-img {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

body {
  font-family: 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
}

.sidebar .links {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.sidebar .links a {
  color: #aad8ff;
  font-weight: bold;
}

ul.no-bullets {
  list-style-type: none;
  padding-left: 0;
  margin: 0 0 20px 0;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 20px 0;
}

.skills-pills li {
  background-color: #0066cc;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  list-style: none;
}

.basic-info {
  margin-bottom: 10px;
}

.basic-info h1, .basic-info h3, .basic-info p {
  margin: 5px 0;
}

.divider {
  width: 60%;
  margin: 10px auto;
  border: none;
  border-top: 2px solid #aad8ff;
}

.email-block {
  margin: 10px 0 20px 0;
  font-size: 0.9em;
}

.links {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 0.9em;
  margin-bottom: 20px;
}

.links a i {
  font-size: 1.3em;
  transition: transform 0.2s, color 0.2s;
}

.links a:hover i {
  transform: scale(1.2);
  color: #ffffff;
  text-shadow: 0 0 5px #aad8ff;
}

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

.main-content section {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
  margin-bottom: 40px;
}

.main-content section:nth-child(1) { --delay: 0.1s; }
.main-content section:nth-child(2) { --delay: 0.3s; }
.main-content section:nth-child(3) { --delay: 0.5s; }

.main-content h2 i {
  margin-right: 10px;
  color: #004080;
}

.timeline {
  position: relative;
  margin-left: 20px;
  border-left: 2px solid #004080;
  padding-left: 20px;
  margin-bottom: 40px
}

.timeline h3 {
  position: relative;
  margin-top: 20px;
}

.timeline h3::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 8px;
  width: 12px;
  height: 12px;
  background-color: #004080;
  border-radius: 50%;
  border: 2px solid white;
  z-index: 1;
}

.project-card {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  background-color: #fafafa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar ul.no-bullets li {
  list-style: none;
  padding-left: 0;
  text-align: center;
}

.timeline-entry {
  margin-bottom: 20px;
  position: relative;
  padding-left: 15px;
}
.timeline-entry h3 {
  margin-bottom: 5px;
}

/* Download button styling */
.download-btn {
  float: right;
  margin-bottom: 20px;
  background-color: #004080;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.download-btn:hover {
  background-color: #0066cc;
}

/* Responsive layout */
@media (max-width: 768px) {
  .resume-container {
    flex-direction: column;
  }
  .sidebar, .main-content {
    width: 100%;
    padding: 20px;
  }
  .links {
    justify-content: center;
  }
}

/* Print layout */
@media print {
  body {
    background: white;
    color: black;
  }
  .download-btn, .links {
    display: none !important;
  }
  .resume-container {
    box-shadow: none;
    margin: 0;
  }
  .sidebar, .main-content {
    width: 100%;
    padding: 0;
  }
  .project-card {
    page-break-inside: avoid;
  }
}

.sidebar h2 + ul {
  text-align: center;
  padding-left: 0;
}

.sidebar h2 + ul li {
  list-style: none;
  margin-bottom: 6px;
}

.download-btn {
  cursor: pointer;
  z-index: 1000;
}

.download-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #004080;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  font-size: 0.9em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 9999;
}

.download-btn:hover {
  background-color: #0066cc;
}

@media screen {
  .download-btn {
    position: fixed;
    top: 20px;
    right: 30px;
    background-color: #004080;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-size: 0.95em;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 9999;
  }

  .download-btn:hover {
    background-color: #005bb5;
  }
}

@media (max-width: 768px) {
  .download-btn {
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    font-size: 0.85em;
  }
}

@media (min-width: 769px) {
  .download-btn {
    top: 80px;
    right: 55px;
  }
}

@media (min-width: 769px) {
  .download-btn {
    top: 64px;
    right: 55px;
  }
}

/* More contrasting and eye-catching color */
.download-btn {
  background-color: #ff5722;
  color: white;
}

.download-btn:hover {
  background-color: #e64a19;
}

@media print {
  .resume-container {
    display: block !important;
  }

  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    float: none;
    width: 100% !important;
    padding: 0 !important;
    text-align: center;
  }

  .main-content {
    width: 100% !important;
    padding: 0 !important;
  }

  .project-card {
    page-break-inside: avoid;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .resume-container {
    display: block !important;
    box-shadow: none;
    margin: 0;
  }

  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    width: 100% !important;
    padding: 20px !important;
    background: #f2f2f2;
    margin-bottom: 30px;
    text-align: center;
  }

  .sidebar h2 {
    margin-top: 20px;
    font-size: 1.1em;
  }

  .main-content {
    width: 100% !important;
    padding: 0 20px !important;
  }

  .sidebar h2 + ul {
    padding-left: 0;
    margin: 5px 0 10px 0;
  }

  .sidebar ul li {
    list-style: none;
    font-size: 0.95em;
  }

  .divider {
    width: 80%;
    margin: 10px auto;
    border: none;
    border-top: 2px solid #ccc;
  }

  .download-btn, .links {
    display: none !important;
  }

  .project-card {
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
}

@media print {
  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    background: none !important;
  }
}

@media print {
  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    background-color: transparent !important;
    box-shadow: none !important;
  }
}

.sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
  background: none !important;
  box-shadow: none !important;
}
@media print {
  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    background: none !important;
    background-color: white !important;
    box-shadow: none !important;
  }
}

@media print {
  body, .sidebar, .main-content, h1, h2, h3, p, li, a {
    color: black !important;
    background: none !important;
    background-color: white !important;
    box-shadow: none !important;
  }

  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    background: none !important;
    background-color: white !important;
  }
}

/* Screen view adjustments */
.sidebar p,
.sidebar a,
.sidebar i,
.sidebar .links,
.sidebar .email-block {
  color: #004080 !important;
  opacity: 1 !important;
}

/* Print view final enforcement */
@media print {
  body, h1, h2, h3, p, li, a, .sidebar, .main-content {
    color: #000000 !important;
    background: none !important;
    background-color: white !important;
    box-shadow: none !important;
  }

  .sidebar img {
    filter: none !important;
  }

  .profile-img {
    border: none !important;
  }

  .sidebar .links i,
  .sidebar a,
  .sidebar p {
    color: #000000 !important;
  }

  .sidebar .email-block,
  .sidebar .skills-pills li {
    color: #000000 !important;
  }
}

/* Screen-only deep blue sidebar background */
@media screen {
  .sidebar {
  background: linear-gradient(to bottom, #003366, #005f99);
    background-color: #004080 !important;
  }

  .sidebar,
  .sidebar a,
  .sidebar p,
  .sidebar h1,
  .sidebar h2,
  .sidebar h3 {
    color: #ffffff !important;
  }

  .skills-pills li {
    background-color: #007BFF !important;
    color: #ffffff !important;
  }

  .sidebar .divider {
    border-top: 2px solid #aad8ff !important;
  }

  .links a i {
    color: #aad8ff !important;
  }

  .links a:hover i {
    color: #ffffff !important;
    text-shadow: 0 0 5px #aad8ff;
  }
}

.certifications ul {
  text-align: center;
  padding: 0;
  list-style: none;
}

.certifications ul li {
  display: block;
  margin: 5px auto;
}

@media print {
  .certifications ul {
    text-align: center !important;
  }

  .certifications ul li {
    display: block;
    margin: 5px auto !important;
  }
}

.certifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.certifications ul {
  display: inline-block;
  padding: 0;
  margin: 0 auto;
  list-style: none;
}

.certifications ul li {
  margin: 5px 0;
}

@media print {
  .certifications {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .certifications ul {
    display: inline-block !important;
    margin: 0 auto !important;
  }

  .certifications ul li {
    margin: 5px 0 !important;
  }
}

.certifications {
  width: 100%;
  text-align: center;
}

.certifications ul {
  display: inline-block;
  list-style-type: none;
  margin: 0 auto;
  padding: 0;
}

.certifications ul li {
  text-align: center;
  display: list-item;
  margin: 4px 0;
}

@media print {
  .certifications {
    width: 100% !important;
    text-align: center !important;
  }

  .certifications ul {
    display: inline-block !important;
    margin: 0 auto !important;
  }

  .certifications ul li {
    display: list-item !important;
    text-align: center !important;
  }
}

.certifications {
  width: 100%;
  text-align: center;
}

.certifications ul {
  list-style-type: none;
  padding: 0;
  margin: 0 auto;
  display: inline-block;
  text-align: left;
}

.certifications ul li {
  display: flex;
  align-items: center;
  margin: 8px 0;
  font-size: 1rem;
}

.cert-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}

@media print {
  .certifications {
    text-align: center !important;
  }

  .certifications ul {
    display: inline-block !important;
    text-align: left !important;
  }

  .certifications ul li {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
}

.certifications {
  width: 100%;
  text-align: center;
}

.certifications .cert-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: inline-block;
  text-align: center;
}

.certifications .cert-list li {
  margin: 6px 0;
  text-align: center;
}

@media print {
  .certifications {
    text-align: center !important;
  }

  .certifications .cert-list {
    display: inline-block !important;
    text-align: center !important;
  }

  .certifications .cert-list li {
    text-align: center !important;
  }
}

/* Floating Back to Top Button */
#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  font-size: 1.2em;
  border: none;
  background-color: #003366;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#backToTop:hover {
  background-color: #005f99;
}

/* Dark Mode Toggle */
.dark-toggle {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 0.9em;
  color: #333;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #eee;
}
body.dark-mode .sidebar {
  background: linear-gradient(to bottom, #1f1f1f, #333);
}
body.dark-mode a {
  color: #90caf9;
}
body.dark-mode .main, body.dark-mode .certifications, body.dark-mode .timeline, body.dark-mode .projects {
  background-color: #1e1e1e;
  color: #ddd;
}

body.dark-mode .main {
  background-color: #000;
  color: #e0e0e0;
}

body.dark-mode .main h1,
body.dark-mode .main h2,
body.dark-mode .main h3 {
  color: #ffffff;
}

body.dark-mode .main a {
  color: #82b1ff;
}

body.dark-mode .timeline::before {
  background-color: #888;
}

body.dark-mode .timeline .entry::before {
  background-color: #fff;
}

body.dark-mode .main-content {
  background-color: #000;
}

body.dark-mode .main-content h2 {
  color: #ffffff;
}

body.dark-mode .project-card {
  background-color: #1c1c1c;
  color: #ffffff;
}

body.dark-mode .toggle-label {
  color: white;
}



body.dark-mode .resume-container {
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

body.dark-mode .dark-mode-toggle label {
  color: white;
}

.dark-mode-toggle {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dark-mode-toggle label {
  font-size: 0.9rem;
  font-weight: bold;
  margin-right: 5px;
}

.dark-toggle {
  position: absolute;
  top: 10px;
  right: 31px;
  z-index: 999;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: bold;
  gap: 5px;
}

body.dark-mode .dark-toggle {
  color: white;
}

@media print {
  .dark-toggle {
    display: none !important;
  }
}

/* Project Card Details Styling */
.project-title {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.project-role, .project-dates {
  font-size: 0.95em;
  color: #666;
  margin-left: 4px;
  font-weight: normal;
}
.project-desc {
  margin-bottom: 6px;
  font-size: 1em;
  color: #222;
}
.project-tech {
  font-size: 0.95em;
  color: #004080;
  margin-bottom: 16px;
  margin-top: 12px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.project-highlights {
  margin: 0 0 0 18px;
  padding: 0 0 0 16px;
  font-size: 0.97em;
  color: #333;
  list-style: disc inside;
}
.project-highlights li {
  margin-bottom: 4px;
  line-height: 1.5;
}
body.dark-mode .project-desc,
body.dark-mode .project-highlights,
body.dark-mode .project-title,
body.dark-mode .project-tech {
  color: #e0e0e0 !important;
}
body.dark-mode .project-tech {
  color: #90caf9 !important;
}

/* Collapsible Project Panel Styles */
.collapsible-project {
  margin-bottom: 18px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  background: #fff;
  transition: box-shadow 0.2s;
}
.collapsible-project .project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 8px 8px 0 0;
  background: #f7faff;
  font-size: 1.08em;
  font-weight: 500;
  outline: none;
  user-select: none;
  transition: background 0.2s;
}
.collapsible-project .project-header:focus, .collapsible-project .project-header:hover {
  background: #e3f0ff;
}
.collapsible-project .collapse-arrow {
  margin-left: auto;
  font-size: 1.2em;
  color: #004080;
  transition: transform 0.2s;
}
.collapsible-project .project-link {
  color: #004080;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}
.collapsible-project .project-link:hover {
  color: #007BFF;
  text-decoration: underline;
}
.collapsible-project .project-body {
  padding: 14px 22px 16px 22px;
  border-top: 1px solid #e0e0e0;
  background: #fafbfc;
  display: none;
  animation: fadeInPanel 0.3s;
}
@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
body.dark-mode .collapsible-project {
  background: #181c22;
  border-color: #333;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
body.dark-mode .collapsible-project .project-header {
  background: #23272f;
  color: #e0e0e0;
}
body.dark-mode .collapsible-project .project-header:focus, 
body.dark-mode .collapsible-project .project-header:hover {
  background: #2a3140;
}
body.dark-mode .collapsible-project .collapse-arrow {
  color: #90caf9;
}
body.dark-mode .collapsible-project .project-link {
  color: #90caf9;
}
body.dark-mode .collapsible-project .project-link:hover {
  color: #fff;
}
body.dark-mode .collapsible-project .project-body {
  background: #23272f;
  border-top: 1px solid #333;
}

@media print {
  .collapsible-project .project-body {
    display: block !important;
    animation: none !important;
    padding: 14px 22px 16px 22px !important;
  }
  .collapsible-project .collapse-arrow {
    display: none !important;
  }
  .collapsible-project .project-header {
    cursor: default !important;
    background: #f7faff !important;
    box-shadow: none !important;
    color: #000 !important;
  }
}

/* Prevent orphaned section headers for print/PDF */
@media print {
  .main-content h2, .main-content section h2, .main-content .side-projects-header {
    page-break-after: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    break-inside: avoid;
  }
  .side-projects-header, .side-projects-section {
    page-break-after: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    break-inside: avoid;
  }
  .collapsible-project {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .main-content h2 i.fa-lightbulb, .main-content section h2 i.fa-lightbulb, .main-content h2.fa-lightbulb, .main-content section h2.fa-lightbulb {
    margin-top: 64px !important;
    display: block;
  }
  .main-content h2.fa-lightbulb, .main-content section h2.fa-lightbulb, .main-content h2 i.fa-lightbulb, .main-content section h2 i.fa-lightbulb {
    margin-top: 64px !important;
  }
  .main-content h2, .main-content section h2 {
    margin-top: 64px !important;
  }
}

/* Profile Articles Styling */
.profile-articles {
  margin: 12px 0 0 0;
  padding: 12px 0 12px 18px;
  border-left: 3px solid #aad8ff;
  background: #f8fbff;
  border-radius: 0 6px 6px 0;
  list-style: none;
}
.profile-articles li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 28px;
  font-size: 1em;
}
.profile-articles li::before {
  content: '\f1ea'; /* fa-newspaper-o (FontAwesome) */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: #004080;
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 1.1em;
}
.profile-articles a {
  color: #004080;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.profile-articles a:hover {
  color: #007BFF;
  text-decoration: underline;
}
body.dark-mode .profile-articles {
  background: #23272f;
  border-left: 3px solid #90caf9;
}
body.dark-mode .profile-articles li::before {
  color: #90caf9;
}
body.dark-mode .profile-articles a {
  color: #90caf9;
}
body.dark-mode .profile-articles a:hover {
  color: #fff;
}

.profile-title {
  font-size: 1.05em;
  font-weight: 500;
  font-style: normal;
  color: #00e5ff;
  background: none;
  border-left: 3px solid #00e5ff;
  padding: 2px 0 2px 28px;
  border-radius: 0;
  margin: 6px 0 10px 0;
  letter-spacing: 0.2px;
  position: relative;
  display: inline-block;
  box-shadow: none;
}
.profile-title::before {
  content: '\f304'; /* fa-pen-nib FontAwesome */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: #aad8ff;
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95em;
  opacity: 0.7;
}
body.dark-mode .profile-title {
  color: #00e5ff;
  border-left: 3px solid #00e5ff;
}
body.dark-mode .profile-title::before {
  color: #90caf9;
}

/* Consistent section spacing for main content */
.main-content section {
  margin-top: 48px;
}
.main-content section:first-of-type {
  margin-top: 0;
}

/* Align section icon and title on the same line */
.main-content h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media print {
  .main-content h2, .main-content section h2 {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .main-content h2 i, .main-content section h2 i {
    font-size: 1.2em;
    line-height: 1;
    position: relative;
    top: 3px;
    margin-bottom: 0 !important;
  }
}

@media (max-width: 480px) {
  .sidebar, .main-content {
    padding: 10px;
  }
  .sidebar .profile-img {
    width: 80px;
    height: 80px;
  }
  .main-content h1, .sidebar h1 {
    font-size: 1.2em;
  }
  .main-content h2, .sidebar h2 {
    font-size: 1em;
  }
  .project-card, .collapsible-project {
    padding: 8px 4px;
    font-size: 0.95em;
  }
  .skills-pills li {
    font-size: 0.8em;
    padding: 4px 8px;
  }
  .profile-title {
    font-size: 1em;
    padding: 3px 10px 3px 28px;
  }
  .profile-articles {
    padding-left: 8px;
    font-size: 0.95em;
  }
  .download-btn {
    font-size: 0.8em;
    padding: 6px 10px;
    top: 10px;
    right: 10px;
  }
}
