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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-light: #f9fafb;
  --text-light: #1f2937;
  --border-light: #e5e7eb;
  --card-light: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  transition:
    background 0.3s,
    color 0.3s;
  overflow-x: hidden;
}

/* Header */
.header {
  background: var(--card-light);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background: var(--bg-light);
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-light);
  /* transform: rotate(180deg); */
}

.logo img {
  max-width: 40px;
}
/* Main Layout */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 350px 1fr 400px;
  gap: 2rem;
}

/* Sidebar */
.sidebar {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: var(--bg-light);
  color: var(--text-light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.photo-upload {
  border: 2px dashed var(--border-light);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-upload:hover {
  border-color: var(--primary);
  background: var(--bg-light);
}

.photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
}

.add-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.add-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* Editor */
.editor {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  min-height: 800px;
}

.section-block {
  background: var(--bg-light);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  cursor: move;
  transition: all 0.2s;
}

.section-block:hover {
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.section-block.dragging {
  opacity: 0.5;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-name {
  font-weight: 600;
  font-size: 1.125rem;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
  font-size: 1rem;
}

.icon-btn:hover {
  background: var(--bg-light);
}

.item-list {
  margin-top: 1rem;
}

.item-card {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-light);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.item-title {
  font-weight: 600;
  color: var(--primary);
}

.item-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.item-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

.item-description {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.skill-bar {
  margin-bottom: 1rem;
}

.skill-name {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.skill-progress {
  height: 8px;
  background: var(--border-light);
  border-radius: 1rem;
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 1rem;
  transition: width 0.3s;
}

/* Preview Panel */
.preview-panel {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.preview-header {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

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

.template-option {
  padding: 0.75rem;
  border: 2px solid var(--border-light);
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.template-option.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.template-option:hover {
  border-color: var(--primary);
}

.preview-container {
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#resume-preview {
  padding: 2rem;
  font-family: "Georgia", serif;
}

/* Resume Templates */
.resume-modern .header-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 2rem;
  margin: -2rem -2rem 2rem -2rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

.resume-modern .photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  margin-bottom: 1rem;
}

.resume-modern h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.resume-modern .title {
  font-size: 1.25rem;
  opacity: 0.9;
}

.resume-classic {
  font-family: "Times New Roman", serif;
}

.resume-classic h1 {
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.resume-section {
  margin-bottom: 1.5rem;
}

.resume-section h2 {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* Two-column layout for preview */
.two-column-layout {
  display: flex;
  gap: 2rem;
}

.left-column,
.right-column {
  flex: 1;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

.close-modal:hover {
  background: var(--bg-light);
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  background-color: #1f2937;
  color: white;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.saved-resume-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Notifications */
.notification {
  position: fixed;
  top: 100px;
  right: 2rem;
  background: var(--success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: slideIn 0.3s;
  z-index: 1001;
}

.notification.show {
  display: block;
}

.notification.error {
  background: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Responsive */
@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .preview-panel {
    position: static;
    max-height: none;
  }
}

.version-item {
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.version-item:hover {
  border-color: var(--primary);
  background: var(--bg-light);
}

.tips-list {
  list-style: none;
}

.tips-list li {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-light);
  border-left: 3px solid var(--primary);
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.saved-resume-item {
  padding: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.saved-resume-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.range-input {
  width: 100%;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--text-light);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger-line.hamburger-active:nth-child(1) {
  opacity: 0;
}

.hamburger-line.hamburger-active:nth-child(2) {
  transform: rotate(-45deg) translate(-7px, 5px);
  transform-origin: center;
}

.hamburger-line.hamburger-active:nth-child(3) {
  transform: rotate(45deg);
  transform-origin: center;
}

/* Mobile Menu Styles */
@media (max-width: 425px) {
  .header-content {
    flex-wrap: wrap;
    position: relative;
  }

  .nav-menu {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-light);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    z-index: 100;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
  }

  .header-actions .btn {
    justify-content: center;
  }

  .hamburger-menu {
    display: flex;
    position: relative;
    z-index: 101;
  }

  .nav-menu.mobile-menu-open {
    display: block;
  }

  /* Adjust layout for mobile */
  .container {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem;
    padding: 0 1rem;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .preview-panel {
    position: static;
    max-height: none;
  }

  /* Adjust preview panel for mobile */
  .preview-header {
    padding: 1rem;
  }

  #resume-preview {
    padding: 1rem;
  }
}
