/* Enable cross-document view transitions for smooth page navigation */
@view-transition {
  navigation: auto;
}

/* Color scheme variables */
:root {
  --text-color: #333;
  --text-muted: #555;
  --text-light: #4a4a4a;
  --bg-color: #fff;
  --bg-secondary: #f5f5f5;
  --link-color: #333;
  --border-color: #dbdbdb;
  --box-shadow-color: rgba(0, 0, 0, 0.75);
  --loading-bg: rgba(255, 255, 255, 0.5);
  --spinner-color: #000;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --text-light: #bbb;
    --bg-color: #1a1a1a;
    --bg-secondary: #242424;
    --link-color: #e0e0e0;
    --border-color: #444;
    --box-shadow-color: rgba(0, 0, 0, 0.9);
    --loading-bg: rgba(26, 26, 26, 0.5);
    --spinner-color: #e0e0e0;
  }

  /* Override Bulma defaults for dark mode */
  html,
  body {
    background-color: var(--bg-color);
    color: var(--text-color);
  }

  /* Hero section */
  .hero,
  .hero-body {
    background-color: var(--bg-secondary);
  }

  .hero .title,
  .hero .subtitle,
  .hero .has-text-dark,
  footer.has-text-dark {
    color: #fff !important;
  }

  /* Inline code */
  code {
    background-color: var(--bg-secondary);
    color: var(--text-color);
  }

  .title,
  .subtitle {
    color: var(--text-color);
  }

  .content {
    color: var(--text-color);
  }

  .content h1,
  .content h2,
  .content h3,
  .content h4,
  .content h5,
  .content h6 {
    color: var(--text-color);
  }

  .content ol,
  .content ul {
    color: var(--text-color);
  }

  .content strong {
    color: var(--text-color);
  }

  .content blockquote {
    background-color: var(--bg-secondary);
    border-left-color: var(--border-color);
  }

  .box {
    background-color: var(--bg-secondary);
    box-shadow: 0 0.5em 1em -0.125em rgba(0, 0, 0, 0.3),
      0 0px 0 1px var(--border-color);
  }

  .card {
    background-color: var(--bg-secondary);
  }

  .card-content {
    background-color: var(--bg-secondary);
  }

  .media-content .content p {
    color: var(--text-color);
  }

  hr {
    background-color: var(--border-color);
  }

  /* Invert signature image for dark mode */
  .signature-image {
    filter: invert(1);
  }

  /* Tag styling for dark mode */
  .tag:not(body) {
    background-color: var(--bg-secondary);
    color: var(--text-color);
  }

  /* Modal styling for dark mode */
  .modal-card-head,
  .modal-card-foot {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
  }

  .modal-card-title {
    color: var(--text-color);
  }

  .modal-card-body {
    background-color: var(--bg-color);
  }

  /* Pagination styling */
  .pagination-previous,
  .pagination-next,
  .pagination-link {
    border-color: var(--border-color);
    color: var(--text-color);
  }

  .pagination-previous:hover,
  .pagination-next:hover,
  .pagination-link:hover {
    border-color: var(--text-muted);
  }
}

html {
  font-family: "Ubuntu", sans-serif;
}

/* Header Styles */
.header-container {
  overflow: hidden;
  padding: 1rem 0;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.header-container .columns {
  align-items: center;
  flex-wrap: nowrap;
}

.logo-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none !important;
  flex: 0 0 auto;
  gap: 1rem;
}

.signature-image {
  max-width: 300px;
  height: auto;
}

.link-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 1 1 auto;
}

.link-container .level {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 0;
}

.active-link {
  margin-right: 1.5rem;
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .signature-image {
    max-width: 150px;
  }

  .active-link {
    margin-right: 1rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    margin-bottom: 1rem;
  }

  .header-container .columns {
    flex-direction: column;
    flex-wrap: wrap;
  }

  .logo-link {
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .signature-image {
    max-width: 250px;
  }

  .link-container {
    justify-content: center;
    width: 100%;
  }

  .link-container .level {
    flex-direction: column;
    justify-content: center;
  }

  .active-link {
    margin-right: 1rem;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem !important;
    box-shadow: none !important;
  }

  .link-container .social-links {
    margin-top: 0;
    padding-bottom: 0;
    flex-direction: row;
  }
}
.social-links a {
  height: 1rem;
  width: 1rem;
}
.profile-image {
  max-width: 115px;
}
.icon-link {
  color: var(--text-color);
  margin-right: 1rem;
}
a:not(.icon-link) {
  color: var(--link-color);
  text-decoration: underline;
}
header a:not(.icon-link) {
  font-size: 1.25rem;
  text-decoration: none;
}
.pointer {
  cursor: pointer;
}
.see-more {
  cursor: pointer;
  flex-direction: row;
  display: flex;
  align-items: center;
}
/* .see-more .icon, */
.see-more svg {
  color: var(--text-muted);
  margin-left: 0.25rem;
  height: 1rem;
  width: 1rem;
}
#formNotification {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
}
#formNotification.open {
  display: block;
}
footer {
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.loading {
  position: absolute;
  top: 1rem;
  left: 0;
  z-index: 1000;
  background-color: var(--loading-bg);
  height: 100%;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lds-dual-ring {
  display: inline-block;
  width: 80px;
  height: 80px;
}
.lds-dual-ring:after {
  content: " ";
  display: block;
  width: 64px;
  height: 64px;
  margin: 8px;
  border-radius: 50%;
  border: 6px solid var(--spinner-color);
  border-color: var(--spinner-color) transparent var(--spinner-color) transparent;
  animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  html {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
@media (max-width: 768px) {
  #contact-actions {
    margin-right: auto;
  }
  #signiture-and-photo {
    justify-content: center;
  }
}

code .tag:not(body) {
  background-color: transparent !important;
}

.project {
  height: 100%;
  display: flex;
  justify-content: center;
  flex: 1;
}
.project .media-left {
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.project .link {
  margin-right: 1rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  text-decoration: none !important;
}
.project .link .icon {
  margin-left: 0.25rem;
  font-size: 1.25rem;
  margin-top: 0.1rem;
  padding-top: 0.7rem;
}

#gallery .columns {
  flex-wrap: wrap;
}
#gallery .columns .image {
  -webkit-box-shadow: 0px 0px 2px 0px var(--box-shadow-color);
  -moz-box-shadow: 0px 0px 2px 0px var(--box-shadow-color);
  box-shadow: 0px 0px 2px 0px var(--box-shadow-color);
  max-width: 100px;
  margin: auto;
  &:hover {
    cursor: pointer;
  }
}
@media (max-width: 768px) {
  #gallery .columns .image {
    max-width: 90vw !important;
  }
}

#gallery .columns .modal img {
  max-height: 90vh;
  max-width: 80vw;
  width: auto;
  margin: auto;
}
@media (max-width: 768px) {
  #gallery .columns .modal img {
    max-width: 90vw !important;
  }
}
#gallery .columns .modal-content {
  width: auto !important;
}

.project-gallery {
  max-width: 400px;
  margin: 1rem auto;
}

.project-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}
.project-header img {
  max-width: 500px !important;
  max-height: 150px !important;
}

.project-website .column > .image {
  max-width: 100% !important;
  max-height: 177px;
  margin: auto;
}

@media (max-width: 768px) {
  .project-gallery {
    max-width: inherit;
  }
  .project-website .column > .image {
    max-height: inherit;
  }
}

#project-timeline a {
  color: var(--link-color);
  text-decoration: underline;
}
#project-timeline ul {
  list-style-type: none;
}

#welcome .content {
  margin-left: auto;
  margin-right: auto;
}
@media only screen and (min-width: 769px) {
  #welcome .content {
    max-width: 70%;
  }
}

.blog-post .blog-post-content a {
  color: var(--link-color);
  text-decoration: underline;
}
.blog-post .blog-post-content h3 {
  font-size: 1.5rem;
}
.blog-index {
  margin-bottom: 3rem !important;
}
.blog-index .subtitle.is-4 {
  margin-bottom: 1rem !important;
}
.blog-index .date {
  font-style: italic;
  margin-bottom: 0.5rem;
  display: block;
}
.blog-index p {
  margin-block-end: 0.5rem !important;
}
.blog-index .see-more {
  font-weight: 500;
}
.blog-index a {
  color: var(--link-color);
}
.pagination-next {
  margin-left: auto;
}

/* Reading list item spacing */
a > h3.subtitle.is-5 {
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
}

a > h3.subtitle.is-5 svg {
  flex-shrink: 0;
}

.content pre > code {
  /* this is way the line will span whole width of `code` component */
  display: grid;
  justify-items: start;
  padding: 1rem 0;
  border-radius: 0.5rem;
}
.content figure {
  margin-left: 0;
  margin-right: 0;
}

/* Code Block Web Component */
code-block {
  display: block;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  background-color: #282c34;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #21252b;
  border-bottom: 1px solid #181a1f;
}

.language-label {
  font-size: 0.875rem;
  color: #abb2bf;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-button {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background-color: transparent;
  border: 1px solid #3e4451;
  border-radius: 0.25rem;
  color: #abb2bf;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background-color: #2c313a;
  border-color: #528bff;
  color: #528bff;
}

.copy-button.copied {
  background-color: #2d5f2e;
  border-color: #46954a;
  color: #8fd892;
}

.copy-button svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.code-block-content {
  display: flex;
}

.line-numbers {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  background-color: #282c34;
  border-right: 1px solid #3e4451;
  user-select: none;
  color: #4b5263;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: right;
  min-width: 3rem;
}

.line-numbers span {
  display: block;
}

code-block pre {
  margin: 0;
  flex: 1;
  overflow-x: auto;
}

code-block pre > code {
  padding: 1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .code-block-header {
    padding: 0.375rem 0.75rem;
  }

  .language-label {
    font-size: 0.75rem;
  }

  .copy-button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .line-numbers {
    padding: 1rem 0.5rem;
    min-width: 2.5rem;
    font-size: 0.75rem;
  }
}
