/* Base Styles */
:root {
  --primary-color: #003366;
  --secondary-color: #f8f8f8;
  --accent-color: #0066cc;
  --text-color: #333;
  --text-light: #666;
  --border-color: #ddd;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 60px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 6px;
  --hover-bg: rgba(0, 51, 102, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: #f5f5f7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

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

a:hover {
  color: #004080;
  text-decoration: underline;
}

ul {
  list-style-type: none;
}

img {
  max-width: 100%;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, var(--primary-color), #002244);
  color: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-content {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.logo {
  margin-bottom: 2rem;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
}

.logo h2 {
  color: white;
  font-size: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .logo h2 {
  display: none;
}

.nav {
  margin-bottom: 2rem;
  flex-grow: 1;
}

.nav ul {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius);
  transition: var(--transition);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  border-left: 3px solid #fff;
  transform: translateX(5px);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dropdown Menu Styles */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-arrow {
  font-size: 12px;
  margin-left: 5px;
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.8);
}

.dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
  color: white;
}

.dropdown-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 15px;
  margin-top: -5px;
  transform: translateY(-10px);
}

.dropdown.open .dropdown-menu {
  max-height: 500px;
  opacity: 1;
  margin-top: 0;
  visibility: visible;
  transform: translateY(0);
}

.sub-nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
  position: relative;
  transition: all 0.3s ease;
}

.sub-nav-link:hover {
  transform: translateX(8px);
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
}

/* End Dropdown Menu Styles */

.sidebar.collapsed .nav-link {
  padding: 0.75rem 0;
  text-align: center;
}

.sidebar.collapsed .nav-link span {
  display: none;
}

.sidebar-toggle {
  text-align: center;
  padding: 1rem 0;
}

.toggle-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 3px;
  background-color: white;
  transition: var(--transition);
}

.toggle-icon::before, .toggle-icon::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: white;
  transition: var(--transition);
}

.toggle-icon::before {
  transform: translateY(-8px);
}

.toggle-icon::after {
  transform: translateY(8px);
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(90deg);
}

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: var(--transition);
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* Section Styles */
.section {
  margin-bottom: 3rem;
  padding: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeSlideUp 0.6s ease-out;
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
}

.section:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
  position: relative;
}

.section-header:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.section:hover .section-header:after {
  width: 100px;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.subsection-title {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  padding-left: 15px;
  border-left: 3px solid var(--accent-color);
}

/* Profile Section */
.profile-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.profile-image {
  flex: 0 0 250px;
  transition: transform 0.3s ease;
}

/* .profile-image:hover {
  transform: scale(1.03);
} */

.profile-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.profile-image img:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.profile-bio {
  flex: 1;
  min-width: 300px;
}

.profile-bio h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.profile-bio p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Education Section */
.education-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.education-item {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

/* .education-item:hover {
  background-color: var(--secondary-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  transform: translateX(10px);
} */

.education-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.education-year {
  flex: 0 0 150px;
  font-weight: 600;
  color: var(--accent-color);
  background-color: rgba(0, 102, 204, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  text-align: center;
}

.education-details {
  flex: 1;
}

.education-details h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.education-item:hover .education-details h3 {
  color: var(--accent-color);
}

.institution {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

/* List Containers */
.list-container {
  padding-left: 1rem;
}

.list-container ul {
  list-style-type: none;
  padding-left: 0;
}

.list-container ul li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  position: relative;
  padding-left: 1.5rem;
  transition: transform 0.2s ease;
}

.list-container ul li:before {
  content: "•";
  color: var(--accent-color);
  font-size: 1.2rem;
  position: absolute;
  left: 0;
}

.list-container ul li:hover {
  transform: translateX(5px);
  color: var(--accent-color);
}

/* Books Section */
.books-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.book-item {
  flex: 0 0 calc(33.333% - 2rem);
  min-width: 200px;
  text-align: center;
  transition: var(--transition);
}

.book-item:hover {
  transform: translateY(-10px);
}

.book-cover {
  width: 180px;
  height: 250px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.book-item:hover .book-cover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  transform: scale(1.05);
}

.book-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.book-item:hover h4 {
  color: var(--accent-color);
}

/* Publications Section */
.publications-search {
  margin-bottom: 1.5rem;
}

#publicationSearch {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
}

#publicationSearch:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.publications-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.publication-item {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--secondary-color);
  transition: var(--transition);
}

.publication-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
  border-left: 3px solid var(--accent-color);
}

.publication-item h4 {
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.publication-item:hover h4 {
  color: var(--accent-color);
}

.publication-item p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.publication-actions {
  display: flex;
  gap: 1rem;
}

.view-btn, .download-btn, .cv-download-btn {
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
}

.view-btn:hover, .download-btn:hover, .cv-download-btn:hover {
  background-color: #004080;
  transform: translateY(-2px);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: var(--border-radius);
  width: 80%;
  position: relative;
  animation: scaleIn 0.3s;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

/* CV Section */
.cv-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cv-download-btn {
  display: inline-block;
}

.cv-preview {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

/* Animation Delays for Sections */
.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }
.section:nth-child(6) { animation-delay: 0.6s; }
.section:nth-child(7) { animation-delay: 0.7s; }
.section:nth-child(8) { animation-delay: 0.8s; }
.section:nth-child(9) { animation-delay: 0.9s; }
.section:nth-child(10) { animation-delay: 1s; }
.section:nth-child(11) { animation-delay: 1.1s; }
.section:nth-child(12) { animation-delay: 1.2s; }
.section:nth-child(13) { animation-delay: 1.3s; }

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  
  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
  
  .book-item {
    flex: 0 0 calc(50% - 2rem);
  }
  
  .education-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .education-year {
    flex-basis: auto;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }
  
  .sidebar.mobile-open {
    width: var(--sidebar-width);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .section {
    padding: 1.5rem;
  }
  
  .profile-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .profile-image {
    margin-bottom: 1.5rem;
  }
  
  .book-item {
    flex: 0 0 100%;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* Mobile Menu Button */
.mobile-menu-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  display: none;
  padding: 0.5rem;
  background-color: var(--primary-color);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mobile-menu-button:hover {
  background-color: var(--accent-color);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .mobile-menu-button {
    display: block;
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.back-to-top:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
  display: flex;
  animation: fadeIn 0.3s;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
