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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.4;
}

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

.editor-panel {
  width: 50%;
  padding: 20px;
  background: #fff;
  overflow-y: auto;
  max-height: 100vh;
  border-right: 2px solid #e0e0e0;
}

.preview-panel {
  width: 50%;
  padding: 20px;
  background: #e8e8e8;
  overflow-y: auto;
  max-height: 100vh;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #0078D4;
}

.editor-header h1 {
  color: #0078D4;
  font-size: 1.5rem;
}

.home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f0f0f0;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.3rem;
  transition: background 0.3s;
}

.home-btn:hover {
  background: #e0e0e0;
}

.download-btn {
  background: #0078D4;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s;
}

.download-btn:hover {
  background: #005a9e;
}

.save-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s;
}

.save-btn:hover {
  background: #218838;
}

.reset-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.3s;
}

.reset-btn:hover {
  background: #5a6268;
}

.status-bar {
  padding: 8px 16px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.status-saved {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-unsaved {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-bar.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-editor {
  margin-bottom: 25px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

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

.section-header h3 {
  color: #0078D4;
  font-size: 1.1rem;
  border-bottom: 2px solid #0078D4;
  padding-bottom: 5px;
}

.add-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.add-btn:hover {
  background: #218838;
}

.field-group {
  margin-bottom: 12px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.field-group label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

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

.item-card {
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
}

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

.delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.delete-btn:hover {
  background: #c82333;
}

.bullet-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.bullet-item input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}

.bullet-item button {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.add-bullet-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 5px;
}

.remove-bullet-btn {
  background: #6c757d;
  color: white;
}

/* CV Preview Styles */
.cv-preview {
  background: white;
  padding: 25px 30px;
  max-width: 210mm;
  margin: 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  font-size: 11px;
  line-height: 1.4;
  font-family: 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.cv-preview * {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.cv-header {
  text-align: center;
  margin-bottom: 10px;
}

.cv-header h1 {
  color: #0078D4;
  font-size: 24px;
  margin-bottom: 5px;
}

.cv-contact {
  color: #333;
  font-size: 11px;
}

.cv-contact a {
  color: #0078D4;
  text-decoration: underline;
}

.cv-section {
  margin-bottom: 8px;
  page-break-inside: avoid;
}

.cv-section-title {
  color: #0078D4;
  font-size: 12px;
  font-weight: bold;
  border-bottom: 2px solid #0078D4;
  padding-bottom: 2px;
  margin-bottom: 5px;
  text-decoration: underline;
}

.cv-profile {
  text-align: justify;
  margin-bottom: 8px;
}

.cv-education-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cv-education-item .institution {
  color: #0078D4;
}

.cv-education-item .date {
  color: #0078D4;
  white-space: nowrap;
}

.cv-experience-item {
  margin-bottom: 6px;
  page-break-inside: avoid;
}

.cv-experience-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cv-experience-header .company {
  color: #0078D4;
  font-weight: bold;
}

.cv-experience-header .date {
  color: #0078D4;
}

.cv-bullets {
  padding-left: 20px;
  list-style-type: disc;
}

.cv-bullets li {
  margin-bottom: 2px;
  text-align: justify;
}

.cv-skills-category {
  margin-bottom: 4px;
}

.cv-skills-category strong {
  color: #0078D4;
}

.cv-publication {
  margin-bottom: 8px;
  page-break-inside: avoid;
}

.cv-publication .pub-title {
  font-weight: bold;
}

.cv-section:last-child {
  page-break-inside: avoid;
  margin-bottom: 0;
}

/* Floating action bar */
.floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.fab-btn {
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.fab-save {
  background: #28a745;
  color: white;
}

.fab-save:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.fab-download {
  background: #0078D4;
  color: white;
}

.fab-download:hover {
  background: #005a9e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.fab-indicator {
  background: #dc3545;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@media print {
  .editor-panel {
    display: none;
  }
  .preview-panel {
    width: 100%;
    padding: 0;
    background: white;
  }
  .cv-preview {
    box-shadow: none;
    padding: 20px;
  }
  .floating-actions {
    display: none;
  }
}
