/* Animation for sliding in from the left */
@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  /* Removed default animation properties, will be applied by JS or specific active class */
  opacity: 0;
}

.slide-in-left-active {
  animation-name: slideInFromLeft;
  animation-duration: 0.5s; 
  animation-timing-function: ease-out; 
  animation-fill-mode: forwards; 
  /* opacity: 1; Ensure final state is visible - Handled by animation forwards */
}

/* Animation for sliding in from the right */
@keyframes slideInFromRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  opacity: 0;
}

.slide-in-right-active {
  animation-name: slideInFromRight;
  animation-duration: 0.5s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  /* opacity: 1; - Handled by animation forwards */
}

/* Animation for sliding in from the top */
@keyframes slideInFromTop {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-top {
  opacity: 0;
}

.slide-in-top-active {
  animation-name: slideInFromTop;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  opacity: 1;
}

/* Animation for sliding in from the bottom */
@keyframes slideInFromBottom {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-bottom {
  opacity: 0;
}

.slide-in-bottom-active {
  animation-name: slideInFromBottom;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  opacity: 1;
}

/* Animation for sliding in from a custom direction */
@keyframes slideInCustom {
  0% {
    transform: translate(var(--slide-custom-x, -100%), var(--slide-custom-y, 0));
    opacity: 0;
  }
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}

.slide-in-custom {
  --slide-custom-x: -100%; /* Default to slide from left */
  --slide-custom-y: 0%;   /* Default to no vertical movement */
  animation-name: slideInCustom;
  animation-duration: 0.5s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  opacity: 0;
}

.typing-animation {
    animation: typing 3s steps(40, end) forwards;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    display: inline-block;
}


.gradient-text-compsci {
    background: linear-gradient(to right, #0a68ff, #23478b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.gradient-text{
    background: linear-gradient(to right, #ff6600, #ffcc00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-text-minecraft {
    background: linear-gradient(to right, #00A86B, #00574B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* Responsive adjustments for skill tabs on mobile */
@media (max-width: 768px) {
    .skill-tab {
        padding-left: 0.36rem; /* Increased by 20% */
        padding-right: 0.36rem; /* Increased by 20% */
        padding-top: 0.9rem; /* Increased by 20% */
        padding-bottom: 0.9rem; /* Increased by 20% */
        margin-left: 0.06rem; /* Increased by 20% */
        margin-right: 0.06rem; /* Increased by 20% */
    }

    .skill-tab h3 {
        font-size: 0.66rem; /* Increased by 10% */
        padding: 0.22rem; /* Increased by 10% */
    }
}

/* Algorithm Visualizer Styles */
#dfs-graph-container,
#binary-search-container {
    overflow-x: auto; /* Allow horizontal scrolling if content overflows */
    width: 100%; /* Ensure they take up available width */
}

#dfs-graph-container svg {
    display: block;
    margin: auto;
    max-width: 100%; /* Ensure SVG scales down */
    height: auto; /* Maintain aspect ratio */
}

/* Styling for nodes in JS to avoid !important */
/* #dfs-graph-container circle.visited - Handled in JS */
/* #dfs-graph-container circle.current - Handled in JS */

#binary-search-array {
    display: flex; /* Changed from potentially default block to flex */
    flex-wrap: wrap; /* Allow elements to wrap on smaller screens */
    justify-content: center; /* Center the wrapped items */
    padding: 5px; /* Add some padding */
}

#binary-search-array .binary-search-element {
    display: inline-flex; /* Use flex to center content easily */
    justify-content: center;
    align-items: center;
    width: 30px; 
    height: 30px; 
    margin: 2px;
    font-size: 0.75rem; /* text-xs */
    border-radius: 0.25rem; /* rounded */
    color: #E2E8F0; /* gray-200 for text */
    transition: background-color 0.3s ease-in-out, opacity 0.3s ease-in-out, transform 0.2s ease;
}

/* Default state for binary search elements is handled by Tailwind classes in JS */
/* Dynamic classes for highlighting states (mid, found, dimmed) are applied via JS */

/* Ensure the skill content area can contain the visualizers */
.skill-content-algo-bg .bg-[#0d1117] {
    min-height: 500px; /* Adjusted min-height for visualizers */
    padding-bottom: 20px; /* Add some padding at the bottom */
}

#start-dfs-btn:disabled,
#start-binary-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 
.gradient-text::after{
  
    color: linear-gradient(to right, #ff6600, #ffcc00);
    position: absolute;
    bottom: 0;
    left: 0;
} */

.gradient-text-pr-1{
background: linear-gradient(to right, #3b82f6, #a855f7);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}

.gradient-text-pr-2{
background: linear-gradient(to right, #22c55e, #14b8a6);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}

.gradient-text-voidlancer{
    background: linear-gradient(to right, #3b82f6, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-text-firebase {
    background: linear-gradient(to right, #ffca28, #fb8c00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}


/* Add or modify existing keyframes and animation classes here */

/* Skill Content Tab Animations */
.skill-content {
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  width: 100%; /* Ensure content takes full width for proper transform */
}

.inactive-skill-content {
  opacity: 0;
  transform: translateX(-30px); /* Start off-screen to the left (or adjust as preferred) */
  /* display: none; will be handled by height: 0 and overflow:hidden for better animation */
  max-height: 0;
  overflow: hidden;
  pointer-events: none; /* Prevent interaction with hidden content */
}

.active-skill-content {
  opacity: 1;
  transform: translateX(0);
  max-height: 1000px; /* Adjust if content can be taller */
  /* display: block; Not needed if using max-height for transition */
}

/* Skill Tab Styles */
.skill-tab {
    border: 2px solid transparent; /* Prepare for gradient border */
    background-clip: padding-box; /* Ensures background doesn't go under border */
}

.skill-tab.active-skill-tab {
    color: #c9d1d9; /* Text color for active tab */
    /* background-color: #30363d !important; /* Original background, will be overridden by gradient or removed if only border is desired */
}

/* Gradient Borders for Active Tabs */
.skill-tab.active-skill-tab-website {
  
    border: 2px solid transparent;
    border-color: #007CF0;
    background-color: rgba(0, 124, 240, 0.1); /* Optional: slight background tint */
}

.skill-tab.active-skill-tab-algo {

    background-color: rgba(121, 40, 202, 0.1); /* Optional: slight background tint */
    border: 2px solid transparent;
    border-color: #7928CA;
}

.skill-tab.active-skill-tab-modding {
 
    border: 2px solid transparent;
    border-color: #FF4D4D;
    background-color: rgba(255, 77, 77, 0.1); /* Optional: slight background tint */
}

/* Gradient Backgrounds for Content Sections */
.skill-content-website-bg {
    background: linear-gradient(135deg, rgba(0, 124, 240, 0.2), rgba(0, 223, 216, 0.4));
    border-radius: 8px; /* Optional: match content styling */
    padding: 0.2rem; /* Optional: ensure padding is consistent */
}

.skill-content-algo-bg {
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.2), rgba(255, 0, 128, 0.4));
    border-radius: 8px;
    padding: 0.2rem;
}

.skill-content-modding-bg {
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.2), rgba(249, 203, 40, 0.4));
    border-radius: 8px;
    padding: 0.2rem;
}

/* Make sure inactive tabs don't have the border image */
.skill-tab.inactive-skill-tab {
    border: 2px solid transparent; /* Ensure no border image inherited */
    background-color: transparent;
    color: #8b949e;
}

.skill-tab.inactive-skill-tab:hover {
    background-color: #21262d;
    color: #c9d1d9;
    border: 2px solid transparent; /* Ensure hover doesn't mess with border structure */
}
 

.skill-tab.inactive-skill-tab {
    background-color: transparent !important;
    color: #8b949e !important;               /* Matches GitHub's inactive tab text color */
}

.skill-tab.inactive-skill-tab:hover {
    background-color: #21262d !important;    /* Optional: Slight background change on hover */
    color: #c9d1d9 !important;               /* Brighten text on hover for inactive tab */
}

/* Ensure the main container for skill contents allows overflow if needed, or set a fixed height */
.skill-section .mt-4 {
    position: relative; /* Needed for absolute positioning of content if that route is taken */
    overflow: hidden; /* Important: Prevents content from showing outside its designated area during transition */
    min-height: 100px; /* Or a suitable height for your content, to prevent collapsing */
}

/* Tailwind's .hidden class is used for content visibility, so no extra CSS needed for .skill-content.hidden */

/* Skill Tab Styles */

.html-span {
    background: linear-gradient(to right, #e34c26, #f77638);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.css-span {
    background: linear-gradient(to right, #264de4, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.js-span {
    background: linear-gradient(to right, #f0db4f, #f7df1e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* 
.cpp-span {
    background: linear-gradient(to right, #f34b7d, #f783ac);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
} */

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d1117;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}