/* Al-folio Inspired Academic Theme */

/* CSS Custom Properties for Theme Colors */
:root {
  --global-bg-color: #ffffff;
  --global-text-color: #000000;
  --global-text-color-light: #828282;
  --global-theme-color: #b509ac;
  --global-hover-color: #b509ac;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #1c1c1d;
  --global-footer-text-color: #b2b2b2;
  --global-divider-color: rgba(0, 0, 0, 0.1);
  --global-card-bg-color: #ffffff;
  --global-highlight-color: #b71c1c;
  
  /* Al-folio specific colors */
  --purple-color: #b509ac;
  --blue-color: #0076df;
  --cyan-color: #2698ba;
  --green-color: #00ab37;
  --grey-color: #828282;
  --grey-color-light: #d0d0d0;
  --grey-color-dark: #1c1c1d;
}

/* Dark Theme */
html[data-theme="dark"] {
  --global-bg-color: #1c1c1d;
  --global-text-color: #d0d0d0;
  --global-text-color-light: #828282;
  --global-theme-color: #2698ba;
  --global-hover-color: #2698ba;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #0f0f0f;
  --global-footer-text-color: #828282;
  --global-divider-color: rgba(255, 255, 255, 0.1);
  --global-card-bg-color: #212529;
  --global-highlight-color: #ff3636;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--global-text-color);
  background-color: var(--global-bg-color);
  padding-top: 70px; /* Space for fixed navbar */
  padding-bottom: 70px;
}

/* Smooth theme transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--global-text-color);
  font-family: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-top: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--global-text-color);
}

a {
  color: var(--global-theme-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--global-hover-color);
  text-decoration: underline;
}

/* Top Navigation Bar (Al-folio style) */
.navbar {
  background-color: var(--global-bg-color);
  border-bottom: 1px solid var(--global-divider-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--global-text-color);
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-link {
  color: var(--global-text-color-light);
  text-decoration: none;
  font-weight: 400;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--global-theme-color);
  border-bottom-color: var(--global-theme-color);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.navbar-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--global-text-color);
  margin: 3px 0;
  transition: 0.3s;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Main Content */
.main-content {
  width: 100%;
  padding: 2rem 0;
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.content-section.active {
  display: block;
}

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

/* Post Layout (Al-folio style) */
.post {
  max-width: 900px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  color: var(--global-text-color);
}

.post-title .font-weight-bold {
  font-weight: 700;
}

.desc {
  color: var(--global-text-color-light);
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Profile Section (Al-folio floating style) */
.profile {
  float: right;
  margin: 0 0 1rem 2rem;
  text-align: center;
  max-width: 300px;
}

.profile img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

/* About Section Text Styling */
.clearfix p {
  text-align: justify;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
}

.clearfix p:last-of-type {
  margin-bottom: 0;
}

.profile img:hover {
  transform: scale(1.05);
}

.more-info {
  font-size: 0.9rem;
  color: var(--global-text-color-light);
  margin-top: 1rem;
}

/* Social Icons */
.social {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social a {
  color: var(--global-text-color-light);
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.social a:hover {
  color: var(--global-theme-color);
  transform: translateY(-2px);
  text-decoration: none;
}

/* News Section */
.news {
  margin: 3rem 0;
}

.news h2 {
  color: var(--global-theme-color);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.news-item {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--global-divider-color);
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  min-width: 100px;
  font-weight: 600;
  color: var(--global-theme-color);
  font-size: 0.9rem;
}

.news-content {
  flex: 1;
  color: var(--global-text-color);
}

/* Publications Section */
.publications {
  margin: 3rem 0;
}

.publications h2 {
  color: var(--global-theme-color);
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.publication {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--global-divider-color);
}

.publication:last-child {
  border-bottom: none;
}

.publication-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.publication-title a {
  color: var(--global-text-color);
}

.publication-title a:hover {
  color: var(--global-theme-color);
}

.publication-authors {
  color: var(--global-text-color-light);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.publication-venue {
  color: var(--global-theme-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.publication-abstract {
  color: var(--global-text-color);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Projects Section */
.projects {
  margin: 3rem 0;
}

.projects h2 {
  color: var(--global-theme-color);
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.project-card {
  background: var(--global-card-bg-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--global-text-color);
}

.project-description {
  color: var(--global-text-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  color: var(--global-theme-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.project-link:hover {
  border-bottom-color: var(--global-theme-color);
  text-decoration: none;
}

/* Featured Projects in About Section */
.featured-projects {
  margin: 1.5rem 0;
}

.project-highlight {
  background: var(--global-card-bg-color);
  border: 1px solid var(--global-divider-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.project-highlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-color: var(--global-theme-color);
}

.project-content {
  flex: 1;
}

.project-highlight h4 {
  color: var(--global-theme-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.project-highlight p {
  color: var(--global-text-color);
  line-height: 1.6;
  margin-bottom: 0;
}

.project-highlight p em {
  color: var(--global-text-color-light);
  font-style: italic;
}

.project-media {
  flex-shrink: 0;
  width: 300px;
  max-width: 40%;
}

.project-media video,
.project-media img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-media video {
  background: #000;
}

/* Contact Section */
.contact {
  margin: 3rem 0;
}

.contact h2 {
  color: var(--global-theme-color);
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--global-text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--global-divider-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--global-theme-color);
}

.btn {
  background-color: var(--global-theme-color);
  color: var(--global-hover-text-color);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: var(--global-hover-color);
  transform: translateY(-2px);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--global-divider-color);
  color: var(--global-text-color);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.theme-toggle:hover {
  background-color: var(--global-theme-color);
  color: var(--global-hover-text-color);
  border-color: var(--global-theme-color);
  transform: scale(1.1);
}

/* Theme specific icons */
.theme-icon {
  transition: opacity 0.2s ease;
}

html[data-theme="light"] .theme-icon-dark {
  display: none;
}

html[data-theme="dark"] .theme-icon-light {
  display: none;
}

/* Dark theme adjustments for form elements */
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea {
  background-color: var(--global-card-bg-color);
  border-color: var(--global-divider-color);
  color: var(--global-text-color);
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus {
  border-color: var(--global-theme-color);
}

/* Dark theme navbar adjustments */
html[data-theme="dark"] .navbar {
  background-color: var(--global-card-bg-color);
  border-bottom-color: var(--global-divider-color);
}

/* Aphorisms Section */
.aphorisms {
  margin: 2rem 0;
}

.aphorisms h2 {
  color: var(--global-theme-color);
  margin: 2rem 0 1rem 0;
  font-size: 1.3rem;
}

.aphorisms ul {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.aphorisms li {
  margin-bottom: 0.25rem;
  padding: 0.2rem 0;
  line-height: 1.3;
  color: var(--global-text-color);
  font-size: 1.1rem;
}

/* Interests Section */
.interests {
  margin: 2rem 0;
}

.interests h2 {
  color: var(--global-theme-color);
  margin: 2rem 0 1rem 0;
  font-size: 1.3rem;
}

.photo-gallery {
  margin: 2rem 0;
}

.photo-gallery iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Aeromodelling Gallery */
.aeromodelling-gallery {
  margin: 2rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Competitions Section */
.competitions {
  margin: 2rem 0;
}

.competition-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem;
  border-radius: 8px;
  background: var(--global-card-bg-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.competition-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.competition-image {
  flex-shrink: 0;
  width: 200px;
}

.competition-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.competition-content {
  flex: 1;
}

.competition-content h3 {
  color: var(--global-theme-color);
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.competition-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.competition-content p:last-child {
  margin-bottom: 0;
}

/* Reading Lists Section */
.reading-lists {
  margin: 3rem 0;
}

.reading-lists h3 {
  color: var(--global-theme-color);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.book-list {
  margin-bottom: 2rem;
}

.book-item {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--global-divider-color);
}

.book-item:last-child {
  border-bottom: none;
}

.book-item h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.book-item h4 a {
  color: var(--global-text-color);
  text-decoration: none;
}

.book-item h4 a:hover {
  color: var(--global-theme-color);
}

.book-item .authors {
  color: var(--global-text-color-light);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.book-item .description {
  color: var(--global-text-color);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--global-bg-color);
    flex-direction: column;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 0;
  }

  .navbar-nav.active {
    display: flex;
  }

  .navbar-toggle {
    display: flex;
  }

  .nav-link {
    padding: 1rem 0;
    border-bottom: 1px solid var(--global-divider-color);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .theme-toggle {
    margin-top: 1rem;
    align-self: center;
  }

  .container {
    padding: 0 1rem;
  }

  .profile {
    float: none;
    margin: 0 auto 2rem;
    text-align: center;
  }

  .profile img {
    width: 150px;
    height: 150px;
  }

  .post-title {
    font-size: 2rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    flex-direction: column;
  }

  .news-date {
    min-width: auto;
    margin-bottom: 0.5rem;
  }

  .news-content {
    margin-left: 0;
  }

  .photo-gallery iframe {
    height: 300px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
  }

  .competition-item {
    flex-direction: column;
    align-items: center;
  }

  .competition-image {
    width: 100%;
    height: auto;
  }

  .project-highlight {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .project-media {
    width: 100%;
    max-width: 400px;
    align-self: center;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 60px;
  }

  .navbar {
    padding: 0.75rem 0;
  }

  .navbar-container {
    padding: 0 1rem;
  }

  .post-title {
    font-size: 1.75rem;
  }

  .profile img {
    width: 120px;
    height: 120px;
  }

  .clearfix p {
    text-align: left;
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
  }

  .photo-gallery iframe {
    height: 250px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  .competition-item {
    padding: 1rem;
  }

  .project-highlight {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .project-highlight h4 {
    font-size: 1.1rem;
  }

  .project-media {
    width: 100%;
    max-width: 100%;
  }
}

/* Utilities */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.text-center {
  text-align: center;
}

.font-weight-bold {
  font-weight: 700;
}

.font-weight-light {
  font-weight: 300;
}

/* Back to top button (Al-folio style) */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

#back-to-top:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}
