/* Custom styles for the portfolio website */
body {
    background-color: #121212;
    color: #E0E0E0;
    font-family: 'Inter', sans-serif;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Custom hover effects */
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Form input focus styles */
input:focus, textarea:focus {
    outline: none;
    border-color: #2563EB;
}

/* Progress bar animation */
@keyframes progressAnimation {
    0% { width: 0; }
    100% { width: 100%; }
}

.progress-bar {
    animation: progressAnimation 1.5s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1E1E1E;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Availability dot animation */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.status-dot {
    animation: pulse 2s infinite;
}

/* Link hover effects */
a {
    transition: all 0.3s ease;
}

a:hover {
    color: white;
}

/* Project image hover effect */
.bg-darkCard img {
    transition: transform 0.4s ease;
}

.bg-darkCard:hover img {
    transform: scale(1.05);
}

/* Navbar styles */
#menuToggle {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

#menuToggle:hover {
    transform: rotate(90deg);
}

#menuToggle i {
    transition: transform 0.4s ease, opacity 0.2s ease;
}

#menuItems {
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(30, 30, 30, 0.95);
    padding: 6px 12px;
    border-radius: 24px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 500px;
    pointer-events: none;
}

#menuItems.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-left a, .menu-right a {
    position: relative;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    transform: translateY(10px);
    margin: 0 2px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.menu-left a.active, .menu-right a.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delay for menu items */
.menu-left a:nth-child(1), .menu-right a:nth-child(1) {
    transition-delay: 0.1s;
}

.menu-left a:nth-child(2), .menu-right a:nth-child(2) {
    transition-delay: 0.15s;
}

.menu-left a:nth-child(3), .menu-right a:nth-child(3) {
    transition-delay: 0.2s;
}

.menu-left a::after, .menu-right a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu-left a:hover::after, .menu-right a:hover::after {
    width: 70%;
}

/* Push content down to accommodate fixed navbar */
.max-w-\[700px\] {
    margin-top: 2.5rem;
}

/* Download CV button */
.download-cv-btn {
    transition: all 0.3s ease;
    border-color: rgba(255, 255, 255, 0.15);
}

.download-cv-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Project cards */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card img {
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.03);
}

.project-card .arrow-icon {
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(4px);
}

/* Experience timeline */
#experience .border-l {
    position: relative;
}

#experience .border-l::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    width: 1px;
    background: linear-gradient(to bottom,
        rgba(107, 114, 128, 0.3) 0%,
        rgba(107, 114, 128, 0.6) 15%,
        rgba(107, 114, 128, 0.6) 85%,
        rgba(107, 114, 128, 0.3) 100%);
}

#experience .w-4.h-4 {
    box-shadow: 0 0 0 4px #121212;
    transition: all 0.3s ease;
}

#experience .mb-12:hover .w-4.h-4,
#experience div:last-child:hover .w-4.h-4 {
    background-color: #2563eb;
    border-color: #3b82f6;
}

/* Stack section items */
#stack .flex.items-start {
    transition: transform 0.3s ease;
}

#stack .flex.items-start:hover {
    transform: translateY(-3px);
}

#stack .w-12.h-12 {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

#stack .flex.items-start:hover .w-12.h-12 {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#stack .h-4.w-4 {
    opacity: 0.7;
    transition: all 0.3s ease;
}

#stack .flex.items-start:hover .h-4.w-4 {
    opacity: 1;
}

/* Articles section */
#articles .rounded-lg {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#articles .flex.flex-col:hover .rounded-lg {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#articles .text-white.group {
    position: relative;
    display: inline-flex;
    overflow: hidden;
}

#articles .text-white.group::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: white;
    transition: width 0.3s ease;
}

#articles .text-white.group:hover::after {
    width: calc(100% - 24px); /* Subtract the width of the arrow icon */
}

#articles img {
    transition: transform 0.5s ease;
}

#articles .flex.flex-col:hover img {
    transform: scale(1.05);
}

/* ── Blog post content typography ── */
#post-content h1,
#post-content h2,
#post-content h3,
#post-content h4,
#post-content h5,
#post-content h6 {
    color: #E0E0E0;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

#post-content h1 { font-size: 1.875rem; }
#post-content h2 {
    font-size: 1.4rem;
    border-bottom: 1px solid #252525;
    padding-bottom: 0.4rem;
}
#post-content h3 { font-size: 1.2rem; }
#post-content h4 { font-size: 1.05rem; }

#post-content p {
    margin-bottom: 1.25rem;
    line-height: 1.85;
    color: #B0B0B0;
}

#post-content a {
    color: #2563EB;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

#post-content a:hover {
    color: #60A5FA;
}

#post-content ul,
#post-content ol {
    margin: 0.5rem 0 1.25rem 1.5rem;
    line-height: 1.85;
    color: #B0B0B0;
}

#post-content ul { list-style-type: disc; }
#post-content ol { list-style-type: decimal; }

#post-content li {
    margin-bottom: 0.35rem;
}

#post-content li strong {
    color: #D0D0D0;
}

#post-content blockquote {
    border-left: 3px solid #2563EB;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: rgba(37, 99, 235, 0.06);
    border-radius: 0 6px 6px 0;
    color: #9CA3AF;
    font-style: italic;
}

#post-content code {
    background: #1a1a2e;
    color: #93C5FD;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

#post-content pre {
    background: #161625;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #252535;
}

#post-content pre code {
    background: none;
    padding: 0;
    color: #E0E0E0;
    font-size: 0.9rem;
}

#post-content hr {
    border: none;
    border-top: 1px solid #252525;
    margin: 2rem 0;
}

#post-content strong {
    color: #E0E0E0;
    font-weight: 600;
}

#post-content em {
    color: #C0C0C0;
    font-style: italic;
}

#post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

#post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

#post-content th {
    background: #1E1E1E;
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #333;
    color: #E0E0E0;
}

#post-content td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #252525;
    color: #B0B0B0;
}

#post-content tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ── Floating share FAB ── */
.share-fab-item {
  position: absolute;
  bottom: 18px; /* vertically centered on toggle button */
  left: 50%;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9999px;
  background: #1E1E1E;
  border: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8B95A1;
  text-decoration: none;
  cursor: pointer;
  transform: translate(-50%, 0) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.2s ease,
              color 0.15s ease,
              border-color 0.15s ease;
}

#share-fab.open .share-fab-item {
  transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.share-fab-item:hover {
  color: #E0E0E0;
  border-color: #374151;
}

#share-fab.open .share-fab-item:nth-child(1) { transition-delay: 0.00s; }
#share-fab.open .share-fab-item:nth-child(2) { transition-delay: 0.04s; }
#share-fab.open .share-fab-item:nth-child(3) { transition-delay: 0.08s; }
#share-fab.open .share-fab-item:nth-child(4) { transition-delay: 0.04s; }
#share-fab.open .share-fab-item:nth-child(5) { transition-delay: 0.00s; }

#share-fab-toggle {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.09), 0 4px 20px rgba(0,0,0,0.7);
}

/* ── Mobile responsiveness ── */
@media (max-width: 640px) {
    /* Navbar menu: drop below button instead of spreading sideways */
    #menuItems {
        top: 48px;
        transform: translateX(-50%);
        min-width: unset;
        width: max-content;
        max-width: calc(100vw - 2rem);
        padding: 8px 10px;
    }

    /* Stack menu items in two wrapped rows */
    #menuItems > div {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .menu-left {
        margin-right: 0 !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .menu-right {
        margin-left: 0 !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Hide the invisible spacer div between left/right menu groups */
    #menuItems .w-9.h-9 {
        display: none;
    }

    /* Slightly smaller text in header on mobile */
    h1.text-3xl {
        font-size: 1.5rem;
    }
}
