:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #1e293b;
  --muted: #64748b;
  --border: #94a3b8;
  --bg: #f8fafc;
  --input-bg: #fff;
}

body.dark {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text: #f5f5f5;
  --muted: #cbd5e1;
  --border: #64748b;
  --bg: #121212;
  --input-bg: #1e1e1e;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  margin: 0;
  padding: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.main-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.form-section, .preview-section {
  background-color: var(--input-bg);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 1.5rem;
  min-width: 320px;
}

.form-section {
  flex: 1 1 350px;
  max-width: 450px;
}

.preview-section {
  flex: 2 1 500px;
  font-size: 13px;
}

.form-group {
  margin-bottom: 1.2rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

input, textarea {
  width: 90%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 0.4rem;
  background-color: var(--input-bg);
  color: var(--text);
  transition: border 0.2s ease;
}

input:focus, textarea:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(37, 99, 235, 0.2);
}

textarea {
  min-height: 80px;
}

.add-btn, .download-btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-btn:hover, .download-btn:hover {
  background-color: var(--primary-hover);
}

.education-inputs, .experience-inputs, .certifications-inputs, .project-input {
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  background-color: var(--bg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.skills-grid div {
  margin-bottom: 0.5rem;
}

.skills-grid label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.header h1 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 0.8rem;
}

.section {
  margin-bottom: 1rem;
}

.section h2 {
  font-size: 1rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
  margin-bottom: 0.5rem;
}

ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

ul li {
  margin-bottom: 0.3rem;
  position: relative;
}

ul li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: -1.2rem;
}

.project-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 12px;
  margin-right: 0.8rem;
}

.project-links a::before {
  content: "🌐";
  margin-right: 0.3rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

.scroll-up-btn {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 999;
  padding: 6px 12px;
  cursor: pointer;
  border: 2px solid var(--border);
  background-color: var(--input-bg);
  color: var(--text);
  border-radius: 20%;
}


@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .form-section, .preview-section {
    max-width: 100%;
    min-width: 0;
    padding: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background-color: var(--input-bg);
  position: absolute;
  bottom: 0;
  z-index: 100;
}

.btn-refresh,
.btn-autofill {
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-refresh:hover,
.btn-autofill:hover {
  background-color: var(--input-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn-refresh:active,
.btn-autofill:active {
  transform: scale(0.98);
}

#themeToggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 999;
  padding: 6px 12px;
  cursor: pointer;
  border: none;
  background-color: var(--input-bg);
  color: var(--text);
  border-radius: 4px;
}
#themeToggle {
  position: fixed;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 32px; /* Increased size */
  cursor: pointer;
  z-index: 1000;
  color: inherit;
  transition: transform 0.2s ease;
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Responsive Footer */

.footer {
  background-color: #f1f1f1;
}

.footer-link {
  color: #b21d1d;
  text-decoration: none;
}

body.dark .footer {
  background-color: #1a1a1a;  
  color: #eee;
  border-top: 1px solid #444; 
  box-shadow: 0 -2px 5px rgba(255, 255, 255, 0.05); 
}

body.dark .footer-link {
  color: #ffcc00; 
}

.improve-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: #007BFF;
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  display: inline-block;
}

.suggestion-box {
  margin-top: 10px;
  font-size: 14px;
  color: green;
  background: #e9fbe9;
  padding: 10px;
  border-left: 4px solid green;
  border-radius: 4px;
  display: none;
}

.suggestion-box.loading {
  color: gray;
  font-style: italic;
  display: block;
}



@media(max-width:768px){
  footer{
    flex-direction: column;
    text-align:center;
    align-items:center;
    padding: 1rem;
    gap:1.5rem;
  }
#themeToggle i.fa-sun {
  color: #FFD700 !important;
}
.char-count {
  font-size: 0.75rem; 
  color: var(--muted); 
  display: block;
  margin-top: -0.2rem; 
  text-align: right; 
  padding-right: 0.7rem; 
}

.error-message {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: -0.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

@media print {
  .no-print{
  display: none !important;
 }
}
}
/* Highlight the section being dragged */
.section.dragging {
  opacity: 0.5;
  background-color: #f0f0f0;
  border: 2px dashed #007bff;
  cursor: grabbing;
  transform: scale(1.02);
  transition: all 0.2s ease-in-out;
}

/* animate section positions */
.section {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
