/* =================================
   Davi Silveira Portfolio - Main Styles
   ================================= */

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

:root {
  --primary: #00455b;
  --accent: #fc7a49;
}

/* Light Theme (Default) */
body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
  --bg-primary: #fcf7f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1c2627;
  --text-secondary: #00455b;
  --text-tertiary: rgba(28, 38, 39, 0.7);
  --border-color: rgba(0, 69, 91, 0.15);
  --nav-bg: rgba(252, 247, 247, 0.95);
  --overlay-gradient: linear-gradient(to top, rgba(252, 247, 247, 0.95), transparent);
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Dark Theme */
body.dark-theme {
  --bg-primary: #1c2627;
  --bg-secondary: rgba(0, 69, 91, 0.15);
  --bg-card: rgba(0, 69, 91, 0.1);
  --text-primary: #fcf7f7;
  --text-secondary: #f4e7e9;
  --text-tertiary: rgba(244, 231, 233, 0.7);
  --border-color: rgba(0, 69, 91, 0.3);
  --nav-bg: rgba(28, 38, 39, 0.95);
  --overlay-gradient: linear-gradient(to top, rgba(28, 38, 39, 0.95), transparent);
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

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

nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  position: relative;
}

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

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

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: 0.3s;
}

/* Theme Toggle */
.theme-toggle {
  width: 50px;
  height: 26px;
  background: var(--border-color);
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background: var(--text-tertiary);
}

.theme-toggle::before {
  content: '☀️';
  position: absolute;
  top: 50%;
  left: 27px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: left 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-theme .theme-toggle::before {
  content: '🌙';
  left: 3px;
}

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

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 69, 91, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(252, 122, 73, 0.08) 0%, transparent 50%);
  z-index: 0;
}

body.dark-theme .hero-bg {
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 69, 91, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(252, 122, 73, 0.1) 0%, transparent 50%);
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero .highlight {
  color: var(--accent);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 600px;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

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

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 30px rgba(0, 69, 91, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 69, 91, 0.4);
  background: #005a75;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
  margin-top: 2rem;
  font-weight: 600;
}

.back-button:hover {
  transform: translateX(-5px);
  border-color: var(--accent);
}

/* =================================
   Page Headers
   ================================= */

.page-header {
  padding: 8rem 2rem 4rem;
  text-align: center;
  max-width: 1400px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

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

section {
  padding: 6rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-tertiary);
  font-size: 1.1rem;
}

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

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

/* Single game card centered */
.games-grid[style*="max-width"] {
  display: block;
}

.game-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(252, 122, 73, 0.3);
  border-color: var(--accent);
}

.game-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.game-info {
  padding: 1.5rem;
}

.game-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.game-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.game-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: rgba(0, 69, 91, 0.15);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 69, 91, 0.3);
}

body.dark-theme .tag {
  background: rgba(0, 69, 91, 0.15);
  color: var(--text-secondary);
  border-color: rgba(0, 69, 91, 0.3);
}

/* =================================
   Film/Work Cards
   ================================= */

.films-grid,
.works-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.film-card,
.work-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

.film-card img,
.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.film-card:hover,
.work-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(252, 122, 73, 0.3);
}

.film-card:hover img,
.work-card:hover img {
  transform: scale(1.1);
}

.film-overlay,
.work-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: var(--overlay-gradient);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
}

.film-card:hover .film-overlay,
.work-card:hover .work-overlay {
  transform: translateY(0);
  opacity: 1;
}

.film-overlay h3,
.work-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.film-overlay p,
.work-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =================================
   Video Pages
   ================================= */

.video-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8rem 2rem 2rem;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-info {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.video-info h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.video-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.video-meta strong {
  color: var(--accent);
}

/* =================================
   Contact Page
   ================================= */

.contact-section {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.contact-content {
  flex: 1;
}

.contact-content h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
}

.contact-content .subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-content p {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  margin-bottom: 3rem;
  max-width: 600px;
  line-height: 1.8;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.contact-item:hover {
  transform: translateX(10px);
  border-color: var(--accent);
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-details h3 {
  font-size: 1rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.contact-details a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.3s;
}

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

.contact-image {
  flex: 1;
  max-width: 500px;
}

.contact-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* =================================
   Stills Gallery
   ================================= */

.gallery {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  column-count: 3;
  column-gap: 1.5rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(252, 122, 73, 0.3);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.3s;
}

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

/* Lightbox Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border-radius: 8px;
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #f1f1f1;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 2001;
}

.close:hover,
.close:focus {
  color: var(--accent);
}

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

footer {
  background: var(--nav-bg);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s;
  margin-top: 4rem;
}

footer p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

footer a {
  color: var(--text-secondary);
  transition: color 0.3s;
  text-decoration: none;
}

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

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

.social-links a:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-3px);
  border-color: transparent;
}

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

@media (max-width: 1200px) {
  .gallery {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu {
    display: flex;
  }

  .games-grid,
  .films-grid,
  .works-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 4rem 1.5rem;
  }

  .contact-section {
    flex-direction: column;
    padding: 6rem 1.5rem 3rem;
  }

  .contact-image {
    order: -1;
  }

  .video-container {
    padding: 6rem 1rem 1rem;
  }

  .video-info {
    padding: 0 1rem;
  }

  .gallery {
    column-count: 1;
    padding: 1.5rem;
  }

  .close {
    top: 10px;
    right: 20px;
    font-size: 40px;
  }
}