/* Global variables and reset */
:root {
  --primary: #2563eb;
  --text: #1e293b;
  --background: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
}

.dark {
  --primary: #3b82f6;
  --text: #f1f5f9;
  --background: #0f172a;
  --card: #1e293b;
  --border: #334155;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background-color: var(--background);
  transition: background-color 0.3s, color 0.3s;
}

/* Features section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

/* How it works */
.how-it-works {
  padding: 5rem 0;
  background: var(--background);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  text-align: center;
}

.step span {
  display: inline-block;
  width: 50px;
  height: 50px;
  line-height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Countries section */
.countries {
  padding: 4rem 0;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  font-size: 3rem;
  margin-top: 2rem;
}

/* Final CTA */
.final-cta {
  padding: 5rem 0;
  text-align: center;
  background: var(--card);
}

/* Hero Canvas */
.hero {
  position: relative;
  padding: 5rem 0;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero .container {
  position: relative;
  z-index: 1;
}

/* Footer */
footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Builder specific styles */
.builder {
  --sidebar-width: 320px;
}

.builder-container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.chat-input {
  display: flex;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sidebar-controls {
  display: flex;
  justify-content: space-around;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-controls button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.theme-selector, .industry-selector, .photo-upload {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 1rem;
}

.preview-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cv-preview {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}

.cv-page {
  width: 210mm;
  min-height: 297mm;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  padding: 20mm;
  box-sizing: border-box;
}

/* Theme toggle */
#theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Location badge */
.location-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 1.1rem;
}

/* Rotating subtitle */
.rotating-subtitle {
  min-height: 2rem;
  margin: 1rem 0;
}

.rotating-subtitle span {
  position: absolute;
  opacity: 0;
  animation: rotateWords 9s infinite;
}

.rotating-subtitle span:nth-child(2) {
  animation-delay: 3s;
}

.rotating-subtitle span:nth-child(3) {
  animation-delay: 6s;
}

@keyframes rotateWords {
  0%, 15% { opacity: 0; transform: translateY(10px); }
  20%, 35% { opacity: 1; transform: translateY(0); }
  40%, 100% { opacity: 0; transform: translateY(-10px); }
}

/* Responsive styles */
@media (max-width: 768px) {
  .builder-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 40vh;
  }
  
  .preview-area {
    height: 60vh;
  }
}
