:root {
  --primary-bg: #080a12;
  --secondary-bg: #0c0606;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --text-light: #e0e7ff;
  --text-dark: #9ca3af;
  --accent-cyan: #22d3ee;
  --accent-cyan-hover: #06b6d4;
  --tab-inactive-bg: rgba(255, 255, 255, 0.05);
  --tab-inactive-hover-bg: rgba(255, 255, 255, 0.1);
  --tab-active-bg: rgba(255, 255, 255, 0.15);
  --tab-active-bg: rgba(255, 255, 255, 0.15);
}

#custom-tooltip {
    position: fixed;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.9);
    color: #e5e5e5;
    padding: 4px 8px;
    border-radius: 6px;
    pointer-events: none;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

* {
  font-family: "Inter", sans-serif;
}
body {
  background: linear-gradient(
    135deg,
    var(--primary-bg) 0%,
    var(--secondary-bg) 100%
  );
  min-height: 100vh;
  color: var(--text-light);
}
.browser-frame {
  background: rgba(30, 30, 35, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}
.tab {
  transition: all 0.2s ease;
  background: var(--tab-inactive-bg);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  padding: 0.6rem 1rem;
}
.tab:not(.active):hover {
  background: var(--tab-inactive-hover-bg);
  transform: translateY(-1px);
}
.tab.active {
  background: var(--tab-active-bg);
}
.address-bar-container {
  background: rgba(10, 10, 15, 0.5);
  backdrop-filter: blur(5px);
}
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  transition: all 0.3s ease;
}
.glass-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
#projects-grid .glass-card,
#deployed-grid .glass-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#projects-grid .glass-card > div:last-child,
#deployed-grid .glass-card > div:last-child {
  flex-grow: 1;
}
.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 130px;
  transition: transform 0.2s ease;
}
.shortcut:hover {
  transform: scale(1.03);
}

.floating {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* --- FIX: Corrected page visibility rules --- */
.content-page {
  display: none !important; /* Force hide inactive pages */
}
.content-page.active {
  display: block !important; /* Default display for active pages */
  animation: fadeIn 0.5s ease-in;
}
#page-404.content-page.active {
  display: flex !important; /* Ensure 404 page uses flex for centering when active */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tabs-container::-webkit-scrollbar {
  display: none;
}
.nav-btn {
  transition: color 0.2s ease;
}
.nav-btn.disabled {
  color: #4b5563;
  cursor: not-allowed;
}

.tech-tag {
  display: inline-block;
  padding: 0.35em 0.9em;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  background-color: rgba(34, 211, 238, 0.2);
  color: var(--accent-cyan);
  border-radius: 9999px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.skill-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease-in-out;
  min-height: 100px;
}
.skill-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.skill-card img,
.skill-card svg {
  transition: transform 0.2s ease-in-out;
  width: 3rem;
  height: 3rem;
}
.skill-card:hover img,
.skill-card:hover svg {
  transform: scale(1.1);
}

#context-menu {
  position: fixed;
  z-index: 10000;
  background-color: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 0.5rem;
  padding: 0.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
}
#context-menu.show {
  display: block;
}
#context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
#context-menu button:hover {
  background-color: var(--accent-cyan);
  color: white;
  border-radius: 0.25rem;
}

.btn-primary {
  background-color: var(--accent-cyan);
  color: #080a12;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}
.btn-primary:hover {
  background-color: var(--accent-cyan-hover);
}
.btn-secondary {
  background-color: #4b5563;
  color: white;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}
.btn-secondary:hover {
  background-color: #374151;
}
.text-about {
  color: #f59e0b;
}
.text-skills {
  color: #84cc16;
}
.text-projects {
  color: #a855f7;
}
.text-demos {
  color: #ec4899;
}
.text-linkedin {
  color: #0ea5e9;
}
.text-github {
  color: #e5e7eb;
}
.text-certs {
  color: #fbbf24;
}
.text-contact {
  color: #22d3ee;
}


/* Scrollbar styles for .content-area */
.content-area::-webkit-scrollbar {
  width: 8px; /* Width of the scrollbar */
}

.content-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05); /* Track background */
  border-radius: 10px;
}

.content-area::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2); /* Thumb color */
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.05); /* Border around the thumb */
}

.content-area::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3); /* Thumb color on hover */
}

/* Custom Text Truncation for consistent heights */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom Dropdown Styling */
.sort-container {
  display: flex;
  align-items: center;
  position: relative;
}

.sort-label {
    display: flex;
    align-items: center;
    color: #e0e7ff;
    font-size: 0.9rem;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}
.sort-label i.fa-arrow-down-up-across-line {
   font-size: 1rem;
   color: #60a5fa; /* Light blue icon */
}
.sort-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    /* Do not use translate or margin math that pushes the box rightwards */
    margin-top: 0.5rem;
    width: 12rem; /* Keep width consistent */
    max-height: 20rem; /* Give it a safe max height */
    overflow-y: auto; /* Allow scrolling if many languages */
    scrollbar-width: thin;
    scrollbar-color: #06b6d4 #1f1f1f; /* Firefox compatible thin colored scrollbar */
    max-width: 90vw; /* Safety constraint for very small screens */
    background-color: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 50;
    padding: 0.25rem 0;
    display: none;
    /* Prevent this element from causing the parent to scroll horizontally */
    transform-origin: top right;
}

/* Custom Scrollbar specifically for the dropdown menu */
.sort-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.sort-dropdown-menu::-webkit-scrollbar-track {
    background: transparent; 
}
.sort-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 10px;
}
.sort-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #06b6d4; /* cyan-500 equivalent */
}

.sort-dropdown-menu.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.sort-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.sort-item:hover {
    background-color: rgba(34, 211, 238, 0.15); /* cyan-400 with opacity */
    color: #fff;
}
.sort-item-icon {
    width: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.5rem;
}
.sort-dot {
    width: 0.375rem;
    height: 0.375rem;
    background-color: #22d3ee; /* cyan-400 */
    border-radius: 50%;
    display: none;
}
.sort-item.selected .sort-dot {
    display: block;
}
.sort-separator {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

/* Projects Header Layout and Alignment fixes */
.projects-header-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

@media (min-width: 768px) {
    .projects-header-container {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: flex-end !important;
        justify-items: stretch !important;
    }
    
    .projects-header-container .projects-title {
        justify-self: start !important;
        margin-bottom: 0 !important;
    }
    
    .projects-header-container .search-input-container {
        justify-self: center !important;
        margin-bottom: 0 !important;
    }
    
    .projects-header-container .projects-header-right {
        justify-self: end !important;
        margin-bottom: 2px !important;
    }
}

/* Custom Project Search Bar Styles with Morphing SVG Animation */
.search-input-container {
    position: relative;
    height: 28px;
    width: 110px; /* Expanded collapsed width to fit icon + label */
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    justify-self: center !important;
    margin-bottom: 0 !important;
}

/* Expanded state on focus or when input is not empty */
.search-input-container:focus-within,
.search-input-container.active-search {
    width: 160px;
}

.search-input-container input#project-search-input {
    background: none !important;
    border: none !important;
    outline: none !important;
    width: 100% !important;
    height: 28px !important;
    padding: 0 32px 0 0 !important; /* Offset text to the left when collapsed */
    z-index: 10;
    position: relative;
    font-family: "Inter", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center !important; /* Center the text in both states */
    -webkit-appearance: none;
}

.search-input-container:focus-within input#project-search-input,
.search-input-container.active-search input#project-search-input {
    padding: 0 20px 0 20px !important; /* Balanced padding when expanded to keep text centered */
    cursor: text;
}

/* Stylized placeholder matching the body text font/color/weight exactly */
.search-input-container input#project-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
    font-family: "Inter", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-container:focus-within input#project-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important; /* slightly dimmer on focus */
}

/* SVG Wrapper: centers the magnifying glass + "Search" text group when collapsed, transitions to fully centered on focus */
.search-input-container .search-svg-wrapper {
    position: absolute;
    height: 28px;
    width: 160px;
    left: calc(50% - 30px); /* Offset to center the icon + "Search" group */
    transform: translateX(-50%);
    top: 0;
    pointer-events: none;
    z-index: 1;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-container:focus-within .search-svg-wrapper,
.search-input-container.active-search .search-svg-wrapper {
    left: 50%; /* Center the SVG relative to the expanded width */
}

.search-input-container .search-svg-wrapper svg {
    display: block;
    height: 28px;
    width: 160px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.4); /* Subtle white border */
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-dashoffset: 271.908px; /* 212.908 + 59 */
    stroke-dasharray: 59px 212.908px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-container:hover .search-svg-wrapper svg {
    stroke: rgba(255, 255, 255, 0.8);
}

/* Active/Focused state for SVG path */
.search-input-container:focus-within .search-svg-wrapper svg,
.search-input-container.active-search .search-svg-wrapper svg {
    stroke-dasharray: 150px 212.908px;
    stroke-dashoffset: 300px;
    stroke: #22d3ee; /* Cyan highlight on focus */
}