/* ========================================
   Phani Kandula - Personal Website
   Design Tokens & Core Styles
   ======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&family=Open+Sans:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
  /* Default Theme (Classic) */
  --bg-primary: #fdfbf7;
  --bg-secondary: #f4f1ea;
  --bg-card: #ffffff;
  --text-primary: #334155;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #b45309;
  --accent-hover: #d97706;
  --border-color: #e2e8f0;
  --nav-bg: rgba(253, 251, 247, 0.95);

  /* Shared Properties */
  /* Typography */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Layout */
  --max-width: 1200px;
  --border-radius: 12px;
  --border-radius-sm: 8px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
}

/* Theme: Safe Simple Sound (Green/Brown/Natural) */
.theme-safe {
  --bg-primary: #f8f9f4;
  --bg-secondary: #f0f2e8;
  --bg-card: #ffffff;
  --text-primary: #2d3426;
  --text-secondary: #4a5441;
  --text-muted: #8a9681;
  --accent: #5d6d3e;
  /* Moss Green */
  --accent-hover: #7b8e55;
  --border-color: #e4e9db;
  --nav-bg: rgba(248, 249, 244, 0.95);
}

/* Theme: Contradiction-Free Living (Blue/Modern) */
.theme-cfl {
  --bg-primary: #f4f7fa;
  --bg-secondary: #e9eff5;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #2563eb;
  /* Vibrant Blue */
  --accent-hover: #3b82f6;
  --border-color: #cbd5e1;
  --nav-bg: rgba(244, 247, 250, 0.95);
}

/* Theme: Your Four Moves (Navy/Yellow/Strong) */
.theme-four {
  --bg-primary: #f1f3f6;
  --bg-secondary: #e5e8ed;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --accent: #1e293b;
  /* Deep Navy as primary */
  --accent-hover: #334155;
  --border-color: #d1d5db;
  --nav-bg: rgba(241, 243, 246, 0.95);
}

/* Theme: Integration Fiction (Monochrome/Noir) */
.theme-integration {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-card: #ffffff;
  --text-primary: #000000;
  --text-secondary: #262626;
  --text-muted: #737373;
  --accent: #171717;
  /* Black/Dark Gray */
  --accent-hover: #404040;
  --border-color: #e5e5e5;
  --nav-bg: rgba(250, 250, 250, 0.95);
}

/* ========================================
   Reset & Base Styles
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: #1e293b;
  /* Darker heading color for contrast */
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

ul,
ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Layout Components
   ======================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

section {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  padding: 0;
  margin: 0;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
  /* Slightly bolder for readability on light */
  font-size: 0.95rem;
  padding: var(--space-sm) 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-medium);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.theme-switcher-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: var(--space-lg);
}

.theme-toggle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast);
}

.theme-toggle:hover {
  transform: scale(1.2);
}

.theme-toggle[data-theme="classic"] {
  background-color: #b45309;
}

.theme-toggle[data-theme="safe"] {
  background-color: #5d6d3e;
}

.theme-toggle[data-theme="cfl"] {
  background-color: #2563eb;
}

.theme-toggle[data-theme="four"] {
  background-color: #0f172a;
}

.theme-toggle[data-theme="integration"] {
  background-color: #171717;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition-fast);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #fefcf9 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(180, 83, 9, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-content {
  z-index: 1;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: var(--space-md);
  color: #1e293b;
  /* Removed gradient text for cleaner literary look */
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 500px;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.hero-image img {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(180, 83, 9, 0.15);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-medium);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(180, 83, 9, 0.2);
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  transition: all var(--transition-medium);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(180, 83, 9, 0.3);
  box-shadow: var(--shadow-md);
}

.card-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  justify-content: center;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.podcast-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--accent);
  font-weight: 600;
  margin-top: var(--space-md);
}

.card-link:hover {
  gap: var(--space-sm);
}

/* ========================================
   Grid Layouts
   ======================================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ========================================
   About Section
   ======================================== */

.about {
  background: var(--bg-secondary);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about-text .highlight {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
  font-style: italic;
  margin-bottom: var(--space-lg);
}

.about-capabilities {
  list-style: none;
  padding: 0;
}

.about-capabilities li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.about-capabilities li::before {
  content: '✓';
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.credential-badge {
  background: rgba(180, 83, 9, 0.08);
  color: var(--accent);
  padding: var(--space-xs) var(--space-md);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(180, 83, 9, 0.2);
}

/* ========================================
   Experience Timeline
   ======================================== */

.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--border-color) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) - 6px);
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.timeline-company {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.timeline-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========================================
   Books & Projects Section
   ======================================== */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.book-card {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-card);
}

.book-cover {
  width: 180px;
  height: 260px;
  margin: 0 auto var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-medium);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card:hover .book-cover {
  transform: scale(1.02) rotate(1deg);
  box-shadow: var(--shadow-lg);
}

.btn-amazon {
  background-color: #ff9900;
  /* Amazon Orange */
  color: #000000;
  border: none;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  transition: all var(--transition-medium);
}

.btn-amazon:hover {
  background-color: #e68a00;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ========================================
   Placeholder Sections
   ======================================== */

.card-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: transform var(--transition-fast);
}

.card-active {
  cursor: pointer;
  transition: all var(--transition-medium);
  display: block;
  /* Ensure it behaves like a block container */
}

.card-active:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card-active:hover .card-logo {
  transform: scale(1.05);
  border-color: var(--accent);
}

/* YouTube Specific Styling */
.btn-youtube {
  background-color: #ff0000;
  /* YouTube Red */
  color: #ffffff;
  border: 2px solid transparent;
}

.btn-youtube:hover {
  background-color: #cc0000;
  color: #ffffff;
  transform: scale(1.05);
}

.btn-linkedin {
  background-color: #0a66c2;
  /* LinkedIn Blue */
  color: #ffffff;
  border: 2px solid transparent;
}

.btn-linkedin:hover {
  background-color: #004182;
  color: #ffffff;
  transform: scale(1.05);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.card-actions .btn {
  margin-top: 0;
  font-size: 0.9rem;
}

.card-link {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-main);
  transition: all var(--transition-fast);
  display: inline-block;
  margin-top: var(--space-sm);
}

.card:hover .card-link,
.card-active:hover .card-link {
  background: var(--text-main);
  color: var(--bg-main);
  border-color: var(--text-main);
}


/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--bg-secondary);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
}

.footer-brand p {
  max-width: 300px;
  font-size: 0.95rem;
}

.footer-links h4,
.footer-contact h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a,
.footer-contact a {
  color: var(--text-secondary);
}

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

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .hero-subtitle {
    margin: 0 auto var(--space-lg);
  }

  .hero-cta {
    justify-content: center;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    max-width: none;
  }
}

@media (max-width: 768px) {
  :root {
    --space-2xl: 3rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-image img {
    width: 250px;
    height: 250px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-cta {
    flex-direction: column;
  }
}