/* Basic Reset & Global Styles */
:root {
  --primary-color: #2c3e50; /* Dark Blue/Grey */
  --secondary-color: #3498db; /* Bright Blue */
  --accent-color: #e74c3c; /* Reddish Accent */
  --bg-color: #f4f6f8;
  --text-color: #333;
  --card-bg-color: #ffffff;
  --border-color: #e0e0e0;
  --sidebar-bg: #34495e; /* Darker shade for sidebar */
  --sidebar-text: #ecf0f1;

  --font-primary: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-secondary: 'Lato', 'Open Sans', sans-serif;
}

/* Dark Mode Variables */
body.dark-mode {
  --primary-color: #5290f2; /* Lighter blue for dark mode heading */
  --secondary-color: #3da9fc;
  --accent-color: #ff6b6b;
  --bg-color: #1e272e; /* Dark background */
  --text-color: #f1f2f6;
  --card-bg-color: #2c3a47; /* Darker card background */
  --border-color: #4a4a4a;
  --sidebar-bg: #222f3e;
  --sidebar-text: #dcdde1;
}

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

body {
  font-family: var(--font-secondary);
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  padding: 20px 0; /* Add some padding for smaller screens before columns kick in */
}

.resume-container {
  max-width: 1200px;
  margin: 30px auto;
  background-color: var(--card-bg-color); /* Main resume background, distinct from body bg */
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  display: flex;
  overflow: hidden; /* For border-radius on children */
  position: relative; /* For theme toggle positioning */
  transition: background-color 0.3s;
}

/* Theme Toggle Button */
#theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  font-size: 1.2em;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background-color 0.3s, transform 0.2s;
}
#theme-toggle:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}
#theme-toggle .fa-sun { display: none; }
body.dark-mode #theme-toggle .fa-sun { display: inline-block; }
body.dark-mode #theme-toggle .fa-moon { display: none; }


/* Sidebar (Left Column) */
.sidebar {
  width: 35%;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 30px 25px;
  transition: background-color 0.3s, color 0.3s;
}

.profile-section {
  text-align: center;
  margin-bottom: 30px;
}

.profile-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid var(--secondary-color);
  object-fit: cover;
  margin-bottom: 15px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.sidebar h1 {
  font-family: var(--font-primary);
  font-size: 2em;
  margin-bottom: 5px;
  color: var(--sidebar-text); /* Ensure h1 color is light in sidebar */
}

.job-title {
  font-size: 1.1em;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-weight: 500;
}

.website-link {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s;
}
.website-link:hover {
    background-color: var(--primary-color);
}
.website-link i {
    margin-right: 5px;
}

.sidebar .section {
  margin-bottom: 25px;
}

.sidebar h2 {
  font-family: var(--font-primary);
  font-size: 1.4em;
  color: var(--secondary-color);
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 8px;
  margin-bottom: 15px;
}
.sidebar h2 i {
  margin-right: 10px;
}

.sidebar p, .sidebar li {
  font-size: 0.95em;
  margin-bottom: 8px;
  color: var(--sidebar-text);
}

.sidebar a {
  color: var(--sidebar-text); /* Lighter link color for sidebar */
  text-decoration: none;
}
.sidebar a:hover {
  color: var(--secondary-color); /* Highlight on hover */
  text-decoration: underline;
}

.skills-list {
  list-style: none;
  padding-left: 0;
}
.skills-list li {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  padding: 6px 12px;
  margin-bottom: 6px;
  border-radius: 5px;
  font-size: 0.9em;
}


/* Main Content (Right Column) */
.main-content {
  width: 65%;
  padding: 40px 30px;
}

.main-content .section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.main-content .section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.main-content h2 {
  font-family: var(--font-primary);
  font-size: 1.6em;
  color: var(--primary-color);
  margin-bottom: 20px;
}
.main-content h2 i {
  margin-right: 12px;
  color: var(--secondary-color);
}


.experience-item, .education-item, .reference-item {
  margin-bottom: 20px;
}
.experience-item:last-child, .education-item:last-child, .reference-item:last-child {
  margin-bottom: 0;
}

.main-content h3 {
  font-family: var(--font-primary);
  font-size: 1.2em;
  color: var(--secondary-color);
  margin-bottom: 5px;
}

.company-name, .institution-name {
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
  font-size: 1em;
}

.main-content p {
  margin-bottom: 10px;
  font-size: 1em;
}

.main-content ul {
  list-style-position: inside;
  padding-left: 5px;
}
.main-content li {
  margin-bottom: 8px;
}

.main-content a {
  color: var(--secondary-color);
  text-decoration: none;
}
.main-content a:hover {
  text-decoration: underline;
  color: var(--accent-color);
}

.reference-note {
    font-style: italic;
    font-size: 0.9em;
    color: #777;
    margin-top: 15px;
}
body.dark-mode .reference-note {
    color: #aaa;
}


/* Responsive Design */
@media (max-width: 992px) {
  .resume-container {
    flex-direction: column;
    margin: 20px auto;
  }
  .sidebar, .main-content {
    width: 100%;
  }
  .sidebar {
    padding-bottom: 20px;
  }
  #theme-toggle {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 576px) {
  body {
    padding: 10px 0;
  }
  .resume-container {
    margin: 10px auto;
    border-radius: 0; /* Full width on very small screens */
  }
  .sidebar, .main-content {
    padding: 20px 15px;
  }
  .profile-pic {
    width: 120px;
    height: 120px;
  }
  .sidebar h1 {
    font-size: 1.8em;
  }
  .sidebar h2 {
    font-size: 1.2em;
  }
  .main-content h2 {
    font-size: 1.4em;
  }
  .main-content h3 {
    font-size: 1.1em;
  }
}

/* Print Styles */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 10pt; /* Smaller font for print */
    padding: 0;
    margin: 0;
  }
  .resume-container {
    box-shadow: none;
    margin: 0;
    border-radius: 0;
    display: block; /* Stack columns for print */
    max-width: 100%;
  }
  #theme-toggle {
    display: none; /* Hide theme toggle button */
  }
  .sidebar {
    width: 30%; /* Adjust sidebar width for print */
    float: left;
    background-color: #f0f0f0 !important; /* Light grey sidebar for print, override JS */
    color: #000 !important;
    padding: 15px;
  }
  .sidebar h1, .sidebar h2, .sidebar p, .sidebar li, .sidebar a {
    color: #000 !important; /* Ensure text is black */
  }
  .sidebar .website-link {
    background-color: #ddd !important;
    color: #000 !important;
  }
  .profile-pic {
    border-color: #666;
  }
  .skills-list li {
      background-color: #e9e9e9 !important;
      color: #000 !important;
  }

  .main-content {
    width: 68%; /* Adjust main content width */
    float: right;
    padding: 15px;
  }
  .main-content .section {
      border-bottom: 1px solid #ccc;
      page-break-inside: avoid; /* Try to keep sections from splitting across pages */
  }
  .main-content h2, .main-content h3, .main-content p, .main-content li, .main-content a {
    color: #000 !important;
  }
  .main-content a {
    text-decoration: none; /* Remove underline for cleaner print */
  }
  .main-content a[href^="http"]:after, .main-content a[href^="mailto"]:after {
    content: " (" attr(href) ")"; /* Show full links when printing */
    font-size: 0.8em;
  }
  .company-name, .institution-name {
      font-weight: bold;
  }
}
