/*
 Author: Arun Roy
*/
:root {
  --primary: #2A5C82;
  --secondary: #FF6B35;
  --accent: #E9C46A;
  --dark: #1A1A1A;
  --light: #F8F9FA;
  --text: #333;
  --spacing: 1rem;
  --max-width: 1200px;
  --radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --card-bg: #ffffff;
}

body.dark-mode {
  --primary: #4A90E2;
  --secondary: #FF8C5A;
  --text: #f0f0f0;
  --light: #121212;
  --card-bg: #1E1E1E;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background-color: var(--secondary);
}

/* Center Layout Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--light);
  text-align: center;
}

/* Center Header */
header {
  padding: 4rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--light);
  margin: 0 auto 1.5rem;
  display: block;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--light);
}

/* Center Navigation */
nav {
  padding: 1rem 0;
  background: var(--light);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
  list-style: none;
}

.nav-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* scaling animation */
.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--secondary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
  color: var(--secondary);
  transform: translateY(-2px);
}

.nav-links a:hover::before {
  transform: scaleY(1);
}

/* Centered Sections */
section {
  padding: 3rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 2rem;
}

/* Centered Education Section */
#education {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}



/* Project grid base layout */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing);
}

/* Project card styling */
/* Project card styling - 3D Flip */
.project-card-container {
  perspective: 1000px;
  height: 450px;
  /* Fixed height required for flip */
}

.project-card {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  box-shadow: none;
  /* Shadow moves to faces */
  background: transparent;
  padding: 0;
}

.project-card-container:hover .project-card {
  transform: rotateY(180deg);
}

.project-card-front,
.project-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.project-card-front img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  /* or cover */
  margin-bottom: 1rem;
  border-radius: 8px;
}

.project-card-back {
  transform: rotateY(180deg);
  background: white;
  /* Clean background for text */
  color: var(--text);
  overflow-y: auto;
  /* Scroll if content too long */
}

.card-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  margin-top: auto;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.card-btn:hover {
  background-color: var(--secondary);
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: auto;
}

.skills-list,
.hobbies-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-info a {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  margin: 0.5rem;
}

.contact-info a:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

/* Adjustments for tablets and desktops */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Mobile Phone */
@media (max-width: 480px) {
  header {
    padding: 3rem 0.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  section {
    padding: 2rem 0.5rem;
  }

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

  .contact-info a {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }
}