/* Modern CSS Reset and Base Styles */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

:root {
  /* Colors */
  --primary-color: #6e40c9;
  --secondary-color: #4a9eff;
  --background-color: #161b22;
  --text-color: #e6edf3;
  --card-background: #1c2128;
  --hover-color: #8b5cf6;
  
  /* Layout */
  --transition-speed: 0.3s;
  --header-height: clamp(60px, 8vh, 80px);
  --footer-height: clamp(50px, 6vh, 60px);
  --container-padding: clamp(1rem, 3vw, 2rem);
  
  /* Common Values */
  --border-color: rgba(255, 255, 255, 0.1);
  --card-padding: 1.25rem;
  --border-radius: 12px;
  --gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  --shadow-color: rgba(110, 64, 201, 0.3);
}

/* Common Styles */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.card-base {
  background: var(--card-background);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed);
}

.hover-lift {
  transition: transform var(--transition-speed);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body {
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* Grid Layout */
.grid-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 var(--container-padding);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header Styles */
header {
  height: var(--header-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background-color: var(--background-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.grid-item-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.logo-img {
  height: 60px;
  width: 60px;
  transition: transform var(--transition-speed);
  display: block;
}

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

/* Navigation */
.menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-item {
  position: relative;
}

.nav-item a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all var(--transition-speed);
  display: block;
}

.nav-item a:hover {
  color: var(--hover-color);
  background-color: rgba(110, 64, 201, 0.1);
}

.focused {
  position: relative;
}

.focused a {
  background: var(--background-color);
  position: relative;
  z-index: 1;
}

.focused::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 8px;
  z-index: 0;
  opacity: 1;
}

.focused::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 8px;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.5;
}

.focused a:hover {
  color: var(--text-color);
  transform: translateY(-1px);
}

/* Main Content Area */
.main-content {
  flex: 1;
  width: 100%;
  padding: 0.5rem 0;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero-section {
  margin: auto;
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem 0;
}

.profile-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile-content h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--text-color);
  margin-bottom: 1rem;
}

.typing-effect {
  font-size: 1.25rem;
  color: var(--secondary-color);
  height: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social-icon {
  font-size: 1.5rem;
  color: var(--text-color);
  transition: all var(--transition-speed);
}

.social-icon:hover {
  color: var(--hover-color);
  transform: translateY(-3px);
}

/* Skills Overview */
.skills-overview {
  margin-bottom: 1rem;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 0.5rem;
  overflow: visible;
  padding-top: 5px;
}

.skill-card {
  background: var(--card-background);
  padding: 1.25rem;
  width: 100%;
  border-radius: 12px;
  text-align: center;
  transition: all var(--transition-speed);
  border: 1px solid rgba(255, 255, 255, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin: auto;
  will-change: transform;
  transform: translateY(0);
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: rgba(110, 64, 201, 0.4);
  box-shadow: 0 4px 20px rgba(110, 64, 201, 0.15);
}

.skill-icon {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.skill-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.2;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-card p {
  font-size: 0.85rem;
  color: rgba(230, 237, 243, 0.8);
  line-height: 1.3;
}

/* Featured Projects */
.featured-projects {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

.featured-projects h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  color: var(--text-color);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
}

/* Tech Stack Styles - Consolidated */
.tech-stack, .tech-section {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tech-stack {
  text-align: center;
  padding: 2rem 0;
}

.tech-stack h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--text-color);
}

.tech-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tech-section {
  @extend .card-base;
  padding: var(--card-padding);
  
  &:hover {
    border-color: rgba(110, 64, 201, 0.4);
    box-shadow: 0 4px 20px rgba(110, 64, 201, 0.15);
  }
}

.tech-section h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

.tech-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.4rem;
  justify-items: center;
  align-content: center;
  padding: 0.25rem;
}

.tech-icon {
  @extend .flex-column;
  align-items: center;
  gap: 0.25rem;
  @extend .hover-lift;
  
  i {
    font-size: 2.2rem;
    color: var(--primary-color);
    transition: color var(--transition-speed);
  }
  
  &:hover i {
    color: var(--secondary-color);
    transform: scale(1.1);
  }
  
  span {
    font-size: 0.7rem;
    color: var(--text-color);
    text-align: center;
    margin-top: 0.25rem;
  }
}

/* Footer */
.grid-item-footer {
  height: var(--footer-height);
  width: 100%;
  padding: 0 1rem;
  background-color: var(--background-color);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 769px) {
  .grid-item-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .main-content {
    margin-bottom: var(--footer-height);
  }
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

.footer-links a:hover {
  color: var(--hover-color);
}

/* Status Badge */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow-color);
  animation: pulse 2s infinite;
  margin-left: 1rem;
  text-align: center;
}

.status::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

.status h4 {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.status h4 a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.status h4 a::before {
  content: '🎓';
  font-size: 1.2em;
}

@keyframes shine {
  0% {
    left: -50%;
  }
  100% {
    left: 100%;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--shadow-color);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--shadow-color);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--shadow-color);
  }
}

/* Availability Section */
.availability-section {
  text-align: center;
  padding: 0.5rem;
  margin-top: 0;
  margin-bottom: 0;
  background: rgba(110, 64, 201, 0.1);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.availability-section h3 {
  text-align: center;
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.availability-section p {
  text-align: center;
  color: var(--text-color);
  line-height: 1.3;
  margin: 0.5rem 0;
}

.availability-section .highlight {
  text-align: center;
  color: var(--primary-color);
  font-weight: 500;
}

/* Media Queries - Consolidated */
@media (max-width: 1100px) {
  .grid-container {
    padding: 0 1rem;
  }

  .header-responsive {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    height: auto;
    min-height: var(--header-height);
  }

  .menu-toggle {
    display: block;
    font-size: 1.5rem;
    margin-left: auto;
    
    &:hover, &:focus {
      outline: none;
    }
  }

  .responsive-order {
    &-first { order: 1; }
    &-second { order: 2; }
    &-third { order: 3; }
  }

  .status {
    order: 2;
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    justify-content: center;
    text-align: center;
  }

  .status h4 {
    width: 100%;
  }

  .status h4 a {
    justify-content: center;
  }

  .grid-item-logo {
    order: 1;
    flex: none;
    height: auto;
  }

  .logo-img {
    height: 50px;
    width: 50px;
  }
}

@media (max-width: 768px) {
  .mobile-stack {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .mobile-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .mobile-padding {
    padding: 0.75rem;
  }

  .mobile-font {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 0.75rem;
    --header-height: 50px;
  }

  .small-screen-hide {
    display: none;
  }

  .small-screen-padding {
    padding: 0.5rem;
  }

  .small-screen-font {
    font-size: 0.8rem;
  }

  .logo-img {
    height: 40px;
    width: 40px;
  }

  .status h4 {
    font-size: 0.9rem;
  }

  .status h4 a {
    padding: 0.25rem 0.5rem;
  }

  .menu {
    padding: 0.5rem;
  }

  .nav-item a {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section, .skills-overview, .featured-projects, .tech-stack {
  animation: fadeIn 1s ease-out;
}

/* Project Cards */
.project-card {
  @extend .card;
}

.project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
  }
}

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

.project-content {
  @extend .card-content;
}

.project-tech {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-description {
  @extend .card-description;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  @extend .button-base;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  background: rgba(110, 64, 201, 0.1);
}

/* CV Page Styles */
.cv-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem var(--container-padding);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--footer-height) - 2rem);
}

.cv-content {
  background: var(--card-background);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.cv-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.5rem;
}

.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  background: var(--gradient);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-speed);
  border: none;
  cursor: pointer;
}

.cv-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.cv-button i {
  font-size: 1.1em;
}

.cv-frame {
  flex: 1;
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.cv-frame iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border: none;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.iframe-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-color);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  width: 100%;
}

.iframe-error i {
  font-size: 3rem;
  color: var(--secondary-color);
}

.iframe-error p {
  font-size: 1.1rem;
  max-width: 400px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .cv-container {
    height: calc(100vh - var(--header-height) - var(--footer-height) - 1rem);
    padding: 0.5rem var(--container-padding);
  }

  .cv-content {
    gap: 0.75rem;
  }

  .cv-actions {
    padding: 0.25rem;
  }

  .cv-button {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 480px) {
  .cv-container {
    padding: 0.25rem var(--container-padding);
  }

  .cv-content {
    gap: 0.5rem;
  }
}

/* Index Page Specific Styles */
.index-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 2rem;
}

.hero-section {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skills-overview {
  padding: 0;
}

/* Skills Page Styles */
.skills-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.skills-header {
  text-align: center;
  padding: 0.25rem 0;
}

.skills-header h1 {
  font-size: 1.8rem;
  text-align: center;
  margin: 0 auto;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skills-header p {
  font-size: 0.9rem;
  color: #8b949e;
  max-width: 600px;
  margin: 0.25rem auto 0;
}

.tech-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 0.5rem 0;
}

.tech-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.75rem;
  flex: 1;
}

.tech-section {
  background: var(--card-background);
  border-radius: 12px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed);
}

.tech-section:hover {
  border-color: rgba(110, 64, 201, 0.4);
  box-shadow: 0 4px 20px rgba(110, 64, 201, 0.15);
}

.tech-section h3 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

.tech-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.tech-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.4rem;
  justify-items: center;
  align-content: center;
  flex: 1;
  padding: 0.25rem;
}

.tech-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0.5rem;
  transition: transform var(--transition-speed);
}

.tech-icon:hover {
  transform: translateY(-2px);
}

.tech-icon i {
  font-size: 2.2rem;
  color: var(--primary-color);
  transition: color var(--transition-speed);
}

.tech-icon:hover i {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.tech-icon span {
  font-size: 0.7rem;
  color: var(--text-color);
  text-align: center;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .skills-container {
    height: calc(100vh - var(--header-height) - var(--footer-height));
  }

  .skills-header {
    padding: 0.25rem 0;
  }

  .skills-header h1 {
    font-size: 1.5rem;
  }

  .skills-header p {
    font-size: 0.8rem;
    padding: 0 1rem;
  }

  .tech-stack {
    padding: 0.5rem 0;
  }

  .tech-section {
    padding: 0.5rem;
  }

  .tech-section h3 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .tech-icons {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 0.3rem;
  }

  .tech-icon i {
    font-size: 1.1rem;
  }

  .tech-icon span {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .tech-section-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 0.5rem;
  }
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1;
}

.menu-toggle i {
  color: var(--primary-color);
  transition: color var(--transition-speed);
}


/* Mobile Navigation */
@media (max-width: 1100px) {
  header {
    padding: 0.5rem;
    height: auto;
    min-height: var(--header-height);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  .grid-item-logo {
    order: 1;
    height: auto;
    padding: 0;
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .grid-item-navbar {
    order: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .status {
    display: none;
  }

  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    width: 100%;
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .menu.active {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item a {
    width: 100%;
    padding: 0.75rem;
    text-align: center;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .grid-container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 1rem 0;
  }

  .hero-section {
    padding: 2rem 0;
  }

  .profile-content h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
  }

  .profile-content h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  }

  .social-links {
    gap: 1rem;
  }

  .social-icon {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 0.75rem;
    --header-height: 50px;
  }

  .logo-img {
    height: 40px;
    width: 40px;
  }

  .status h4 {
    font-size: 0.9rem;
  }

  .status h4 a {
    padding: 0.25rem 0.5rem;
  }

  .menu {
    padding: 0.5rem;
  }

  .nav-item a {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Improve form responsiveness */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card-background);
  color: var(--text-color);
  border-radius: 6px;
}

button {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--text-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

button:hover {
  background: var(--hover-color);
  transform: translateY(-2px);
}

/* Improve table responsiveness */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }

  th, td {
    padding: 0.75rem;
    min-width: 120px;
  }
}

/* Improve image responsiveness */
img {
  max-width: 100%;
  height: auto;
}

/* Add smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

/* Button Styles */
.button-base {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--text-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  
  &:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
  }
}

.button-gradient {
  @extend .button-base;
  background: var(--gradient);
  box-shadow: 0 4px 15px var(--shadow-color);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
  }
  
  &:hover::before {
    left: 100%;
  }
}

/* Card Styles */
.card {
  @extend .card-base;
  padding: var(--card-padding);
  @extend .hover-lift;
  overflow: hidden;
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.card-description {
  color: rgba(230, 237, 243, 0.8);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  @extend .grid;
  grid-template-columns: repeat(2, 1fr);
}

.grid-auto-fit {
  @extend .grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Form Elements */
.form-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  background: var(--card-background);
  color: var(--text-color);
  border-radius: 6px;
}

/* Table Styles */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  
  th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Animation Utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  0% { left: -50%; }
  100% { left: 100%; }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--shadow-color);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--shadow-color);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--shadow-color);
  }
}

.animate-fade-in {
  animation: fadeIn 1s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Responsive Layout Utilities */
.responsive-grid {
  display: grid;
  gap: var(--grid-gap, 1rem);
  grid-template-columns: repeat(var(--grid-cols, auto-fit), minmax(var(--min-width, 250px), 1fr));
}

.responsive-flex {
  display: flex;
  gap: var(--flex-gap, 1rem);
  flex-wrap: var(--flex-wrap, wrap);
}

/* Spacing Utilities */
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.p-xl { padding: 2rem; }

.m-sm { margin: 0.5rem; }
.m-md { margin: 1rem; }
.m-lg { margin: 1.5rem; }
.m-xl { margin: 2rem; }

/* Typography Utilities */
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.25rem; }
.text-xl { font-size: 1.5rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Flex Utilities */
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

/* Border Utilities */
.border {
  border: 1px solid var(--border-color);
}

.rounded-sm { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

/* Shadow Utilities */
.shadow-sm { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1); }

/* Visibility Utilities */
.hidden { display: none; }
.visible { display: block; }
.invisible { visibility: hidden; }
.visible { visibility: visible; }

/* Z-index Utilities */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Apply these utilities to existing components */
.hero-section {
  @extend .flex-center;
  @extend .animate-fade-in;
  padding: 0;
}

.skills-overview {
  @extend .responsive-grid;
  --min-width: 200px;
  @extend .animate-fade-in;
  padding: 0;
}

.tech-stack {
  @extend .flex-column;
  @extend .animate-fade-in;
  flex: 1;
}

.project-grid {
  @extend .responsive-grid;
  --min-width: 300px;
  --grid-gap: 2rem;
}

.status {
  @extend .animate-pulse;
  @extend .rounded-xl;
  @extend .relative;
  background: var(--gradient);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}