/* Custom styles for developer portfolio layout */

/* Root variables */
:root {
  --profile-width: 280px;
  --profile-avatar-size: 90px;
}

/* Hide the default centered profile image on homepage */
.md-content img[alt="Ramsi Kalia"] {
  display: none;
}

/* Sidebar identity card */
.md-sidebar--primary {
  width: var(--profile-width);
}

.md-sidebar__scrollwrap {
  position: sticky;
  top: 2.4rem;
}

/* Hide the redundant navigation menu in left sidebar */
.md-sidebar--primary .md-nav--primary > .md-nav__list {
  display: none;
}

/* Custom identity card in sidebar */
.identity-card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.identity-card__avatar {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  object-fit: cover;
  border: 3px solid var(--md-accent-fg-color);
}

.identity-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--md-default-fg-color);
}

.identity-card__role {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.identity-card__social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.identity-card__social a {
  color: var(--md-default-fg-color--light);
  font-size: 1.25rem;
  transition: color 0.2s;
}

.identity-card__social a:hover {
  color: var(--md-accent-fg-color);
}

.identity-card__counter {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

.identity-card__counter-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-accent-fg-color);
  margin-top: 0.25rem;
}

/* Homepage hero section */
.hero-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.hero-section__role {
  font-size: 1.25rem;
  color: var(--md-accent-fg-color);
  font-weight: 500;
  margin: 0 0 1rem 0;
}

.hero-section__summary {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
  max-width: 700px;
}

/* Section spacing and hierarchy */
.md-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 700;
  border-bottom: 2px solid var(--md-accent-fg-color);
  padding-bottom: 0.5rem;
}

.md-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Remove the old centered visitor counter */
.md-content > div[style*="text-align: center"][style*="background-color"] {
  display: none;
}

/* Project cards styling */
.md-content ul li {
  margin-bottom: 0.75rem;
}

/* Project card wrapper */
.project-card-wrapper {
  margin-bottom: 1.5rem;
}

/* Project card component */
.project-card {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-card__content {
  grid-column: 1;
}

.project-card__icon {
  grid-column: 2;
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 8px;
}

.project-card__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--md-accent-fg-color);
}

.project-card__description {
  margin: 0 0 0.75rem 0;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
}

.project-card__tech {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  font-weight: 500;
  margin: 0;
}

/* Dark mode adjustments for project cards */
[data-md-color-scheme="slate"] .project-card {
  background: var(--md-code-bg-color);
  border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .project-card:hover {
  border-color: var(--md-accent-fg-color);
}

/* Footer visitor counter (alternative placement) */
.md-footer-meta {
  position: relative;
}

.footer-counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
  background: var(--md-default-bg-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--md-default-fg-color--lightest);
}

.footer-counter__value {
  font-weight: 700;
  color: var(--md-accent-fg-color);
}

/* Improve link styling */
.md-content a {
  color: var(--md-accent-fg-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.md-content a:hover {
  border-bottom-color: var(--md-accent-fg-color);
}

/* Better spacing for lists */
.md-content ul {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media screen and (max-width: 76.1875em) {
  .identity-card {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .project-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .project-card__icon {
    grid-column: 1;
    grid-row: 1;
    margin: 0 auto 1rem;
  }
  
  .project-card__content {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .identity-card {
  background: var(--md-code-bg-color);
  border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .identity-card__avatar {
  border-color: var(--md-accent-fg-color);
}

/* Enhanced project page styling */

/* Project page header */
.md-content article > h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Project page image */
.md-content article > p > img {
  margin: 2rem auto;
  display: block;
  max-width: 400px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Project page subtitle/description - only the first paragraph after h1 */
.md-content article > h1 + p > strong:only-child {
  font-size: 1.15rem;
  line-height: 1.6;
  display: block;
  margin-bottom: 2rem;
  color: var(--md-default-fg-color--light);
}

/* Section dividers */
.md-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--md-default-fg-color--lightest) 20%,
    var(--md-default-fg-color--lightest) 80%,
    transparent
  );
  margin: 3rem 0;
}

/* Enhanced tables */
.md-content table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 2rem 0;
}

.md-content table thead {
  background: var(--md-accent-fg-color);
  color: white;
}

.md-content table thead th {
  padding: 1rem;
  font-weight: 600;
  text-align: left;
  border: none;
}

.md-content table tbody tr {
  transition: background-color 0.2s;
}

.md-content table tbody tr:hover {
  background: var(--md-code-bg-color);
}

.md-content table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-content table tbody tr:last-child td {
  border-bottom: none;
}

/* Admonitions (info boxes) styling */
.md-typeset .admonition {
  border-left: 4px solid var(--md-accent-fg-color);
  border-radius: 4px;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.md-typeset .admonition-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.md-typeset .admonition.info {
  border-left-color: #2196f3;
}

.md-typeset .admonition.success {
  border-left-color: #4caf50;
}

.md-typeset .admonition.warning {
  border-left-color: #ff9800;
}

.md-typeset .admonition.tip {
  border-left-color: #00bcd4;
}

.md-typeset .admonition.note {
  border-left-color: #9c27b0;
}

.md-typeset .admonition.example {
  border-left-color: #673ab7;
}

/* Code blocks */
.md-content pre {
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

.md-content pre code {
  white-space: pre;
  word-wrap: normal;
  font-size: 0.85em;
  line-height: 1.6;
}

.md-content code {
  background: var(--md-code-bg-color);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Fix for text/diagram code blocks - make them wrap */
.md-content pre code.language-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8em;
}

/* Definition lists */
.md-content dl {
  margin: 1.5rem 0;
}

.md-content dt {
  font-weight: 600;
  margin-top: 1rem;
  color: var(--md-accent-fg-color);
}

.md-content dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--md-default-fg-color--light);
}

/* Better list spacing in project pages */
.md-content article ul li,
.md-content article ol li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Nested lists */
.md-content article ul ul,
.md-content article ol ul,
.md-content article ul ol,
.md-content article ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Skills section styling */
.md-content h2 + p {
  margin-top: 1rem;
}

/* Back to projects link */
.md-content article > p:last-child {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  text-align: center;
}

/* Dark mode table adjustments */
[data-md-color-scheme="slate"] .md-content table {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-md-color-scheme="slate"] .md-content table thead {
  background: var(--md-accent-fg-color);
}

[data-md-color-scheme="slate"] .md-content table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Typography improvements */
.md-content p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.md-content strong {
  font-weight: 600;
  color: var(--md-default-fg-color);
}

/* Section spacing */
.md-content section {
  margin-bottom: 3rem;
}

/* Blockquotes */
.md-content blockquote {
  border-left: 4px solid var(--md-accent-fg-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--md-default-fg-color--light);
  font-style: italic;
}

/* Section labels - clean portfolio style */
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

[data-md-color-scheme="slate"] .section-label {
  color: #999;
}

/* Ensure content after section labels looks normal */
.section-label + p strong,
.section-label + p {
  font-size: inherit;
  color: var(--md-default-fg-color);
}
