/* ===============================
   RESPONSIVE PORTFOLIO GENERATOR
   Mobile First Approach
================================ */

/* ===============================
   CSS RESET & VARIABLES
================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00d4ff;
  --primary-dark: #00a8cc;
  --secondary: #7c3aed;
  --accent: #4ecdc4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-input: #1a1a25;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --border-color: rgba(0, 212, 255, 0.2);
  --glow: 0 0 20px rgba(0, 212, 255, 0.3);
  --transition: all 0.3s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===============================
   MAIN CONTAINER
================================ */
.generator-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse at top left, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
    var(--bg-dark);
  padding: 20px 15px;
}

/* ===============================
   HEADER
================================ */
.generator-header {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 100%;
}

/* Header Icon / Photo */
.header-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.25rem;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box;
  padding: 3px;
  animation: glow-pulse 3s ease-in-out infinite;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.3);
}

.header-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header-icon i {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  background: var(--bg-card);
  border-radius: 50%;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 35px rgba(124, 58, 237, 0.5); }
}

.generator-title {
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  font-weight: 800;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #4ecdc4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  padding: 0 10px;
}

.generator-subtitle {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  line-height: 1.7;
  padding: 0 10px;
}

/* Rotating Cube Icon */
.rotating-cube {
  display: inline-block;
  animation: rotateCube 4s linear infinite;
}

@keyframes rotateCube {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ===============================
   MAIN LAYOUT - WRAPPER
================================ */
.generator-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* ===============================
   FORM CARD
================================ */
.generator-form {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ===============================
   FORM SECTIONS
================================ */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.form-section:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  margin-bottom: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.form-section-title i {
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===============================
   FORM GRID
================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

/* ===============================
   FORM INPUTS
================================ */
.form-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 2px solid transparent;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover,
.form-textarea:hover {
  border-color: rgba(0, 212, 255, 0.3);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(0, 212, 255, 0.03);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #666;
}

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

/* ===============================
   SKILLS SECTION
================================ */
.skill-category-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-category-label {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.skill-category-label i {
  font-size: 0.85rem;
}

.skill-input-row {
  display: grid;
  grid-template-columns: 1fr 70px 40px;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  align-items: center;
}

.skill-input-row .skill-name {
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
}

.skill-input-row .skill-percent {
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.remove-skill-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.remove-skill-btn:hover,
.remove-skill-btn:active {
  background: #ef4444;
  color: white;
}

.add-skill-btn {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  transition: var(--transition);
  margin-top: 0.35rem;
}

.add-skill-btn:hover,
.add-skill-btn:active {
  background: rgba(78, 205, 196, 0.15);
  border-style: solid;
}

/* ===============================
   PROJECT BLOCK
================================ */
.dynamic-field {
  background: rgba(0, 0, 0, 0.25);
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.dynamic-field:hover {
  border-color: rgba(0, 212, 255, 0.2);
}

/* ===============================
   ADD PROJECT BUTTON
================================ */
.add-field-btn {
  background: transparent;
  border: 2px dashed var(--primary);
  color: var(--primary);
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}

.add-field-btn:hover,
.add-field-btn:active {
  background: rgba(0, 212, 255, 0.1);
  border-style: solid;
}

/* ===============================
   GENERATE BUTTON
================================ */
.generate-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  color: white;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.generate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.generate-btn:hover::before,
.generate-btn:active::before {
  left: 100%;
}

.generate-btn:hover,
.generate-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.4);
}

/* ===============================
   PREVIEW CONTAINER
================================ */
.preview-container {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ===============================
   PREVIEW HEADER
================================ */
.preview-header {
  margin-bottom: 1.25rem;
}

.preview-title {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.preview-title i {
  color: var(--primary);
}

/* ===============================
   TOGGLE BUTTONS
================================ */
.preview-toggle {
  display: flex;
  background: var(--bg-input);
  padding: 0.3rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.toggle-btn {
  flex: 1;
  min-width: 70px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* ===============================
   COPY BUTTON
================================ */
.copy-btn-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover,
.copy-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.copy-btn i {
  font-size: 0.9rem;
}

/* ===============================
   CODE PREVIEW AREA
================================ */
.preview-content {
  height: 350px;
  background: #0d0d12;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.code-preview {
  width: 100%;
  height: 100%;
  background: transparent;
  color: #e0e0e0;
  padding: 1rem;
  overflow: auto;
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
  margin: 0;
  display: none;
  -webkit-overflow-scrolling: touch;
}

.code-preview::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.code-preview::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

/* ===============================
   STATUS MESSAGE
================================ */
.status-message {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 24px;
  padding: 0.5rem;
  border-radius: 8px;
}

/* ===============================
   DOWNLOAD SECTION
================================ */
.download-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.download-section h4 {
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.download-section > p {
  color: #b0b0b0;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.download-btns {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* ===============================
   DOWNLOAD BUTTONS
================================ */
.file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  transition: var(--transition);
  width: 100%;
}

.file-btn:hover,
.file-btn:active {
  transform: translateY(-2px);
}

.html-btn {
  background: linear-gradient(135deg, #e34c26, #f06529);
  box-shadow: 0 6px 15px rgba(227, 76, 38, 0.3);
}

.css-btn {
  background: linear-gradient(135deg, #264de4, #2965f1);
  box-shadow: 0 6px 15px rgba(38, 77, 228, 0.3);
}

.js-btn {
  background: linear-gradient(135deg, #f0db4f, #e0cb3f);
  color: #1a1a1a;
  box-shadow: 0 6px 15px rgba(240, 219, 79, 0.3);
}

.download-all-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
  margin-top: 0.35rem;
}

.download-all-btn:hover,
.download-all-btn:active {
  background: var(--accent);
  color: #0a0a0f;
}

/* ===============================
   ABOUT / HOW IT WORKS
================================ */
.about {
  background: rgba(18, 18, 26, 0.5);
  margin-top: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

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

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.about-text {
  color: var(--text-secondary);
}

.about-text h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.about-text ol,
.about-text ul {
  padding-left: 1.25rem;
  line-height: 1.8;
}

.about-text li {
  margin-bottom: 0.35rem;
}

.about-visual {
  display: flex;
  justify-content: center;
}

.profile-card {
  position: relative;
  width: 180px;
  height: 180px;
}

.profile-image {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.image-placeholder {
  color: var(--primary);
}

.card-glow {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  border-radius: 22px;
  z-index: -1;
  opacity: 0.35;
  filter: blur(15px);
}

/* ===============================
   FOOTER
================================ */
.footer {
  background: rgba(18, 18, 26, 0.8);
  padding: 2rem 15px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2rem;
}

.footer-content p {
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.footer-social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-decoration: none;
  transition: var(--transition);
}

.footer-social-link:hover,
.footer-social-link:active {
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  border-color: transparent;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

.footer-social-link:nth-child(2):hover,
.footer-social-link:nth-child(2):active {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.footer-social-link:nth-child(3):hover,
.footer-social-link:nth-child(3):active {
  background: linear-gradient(135deg, #0077b5, #00a0dc);
}

/* ===============================
   RESPONSIVE - TABLET (768px+)
================================ */
@media (min-width: 768px) {
  .generator-container {
    padding: 30px 20px;
  }

  .generator-header {
    padding: 2.5rem 1.5rem;
  }

  .header-icon {
    width: 80px;
    height: 80px;
  }

  .generator-wrapper {
    padding: 1.5rem;
  }

  .generator-form,
  .preview-container {
    padding: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .skill-input-row {
    grid-template-columns: 1fr 90px 42px;
    gap: 0.75rem;
  }

  .add-field-btn {
    width: auto;
  }

  .preview-content {
    height: 400px;
  }

  .code-preview {
    font-size: 0.8rem;
    padding: 1.25rem;
  }

  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .profile-card {
    width: 220px;
    height: 220px;
  }
}

/* ===============================
   RESPONSIVE - DESKTOP (1024px+)
================================ */
@media (min-width: 1024px) {
  .generator-container {
    padding: 30px;
  }

  .generator-header {
    padding: 3rem 2rem;
  }

  .header-icon {
    width: 90px;
    height: 90px;
  }

  .generator-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding: 2rem 1rem;
  }

  .preview-container {
    position: sticky;
    top: 20px;
    height: fit-content;
  }

  .preview-content {
    height: 450px;
  }

  .code-preview {
    font-size: 0.82rem;
  }

  .about-content {
    gap: 4rem;
  }

  .profile-card {
    width: 250px;
    height: 250px;
  }
}

/* ===============================
   RESPONSIVE - LARGE DESKTOP (1200px+)
================================ */
@media (min-width: 1200px) {
  .generator-form,
  .preview-container {
    padding: 2.5rem;
  }

  .preview-content {
    height: 500px;
  }
}

/* ===============================
   SMALL PHONES (360px and below)
================================ */
@media (max-width: 360px) {
  html {
    font-size: 14px;
  }

  .generator-container {
    padding: 15px 10px;
  }

  .generator-form,
  .preview-container {
    padding: 1rem;
    border-radius: 16px;
  }

  .header-icon {
    width: 60px;
    height: 60px;
  }

  .skill-input-row {
    grid-template-columns: 1fr 60px 36px;
    gap: 0.35rem;
  }

  .skill-input-row .skill-name,
  .skill-input-row .skill-percent {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .remove-skill-btn {
    width: 36px;
    height: 36px;
  }

  .toggle-btn {
    padding: 0.5rem 0.35rem;
    font-size: 0.75rem;
    min-width: 60px;
  }

  .preview-content {
    height: 280px;
  }

  .code-preview {
    font-size: 0.65rem;
    padding: 0.75rem;
  }

  .file-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .footer-social-link {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* ===============================
   TOUCH DEVICE IMPROVEMENTS
================================ */
@media (hover: none) and (pointer: coarse) {
  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .toggle-btn,
  .file-btn,
  .generate-btn,
  .add-field-btn,
  .add-skill-btn,
  .remove-skill-btn,
  .copy-btn,
  .download-all-btn,
  .footer-social-link {
    min-height: 44px; /* Apple's recommended touch target */
  }

  .toggle-btn {
    min-height: 40px;
  }
}

/* ===============================
   LANDSCAPE MODE PHONES
================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .generator-header {
    padding: 1rem;
  }

  .header-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0.75rem;
  }

  .preview-content {
    height: 250px;
  }

  section {
    padding: 2rem 0;
  }
}

/* ===============================
   PRINT STYLES
================================ */
@media print {
  .generator-container {
    background: white;
  }

  .preview-container,
  .footer-social {
    display: none;
  }
}

/* ===============================
   REDUCE MOTION
================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===============================
   DARK MODE SCROLLBAR
================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-dark);
}

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

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

*::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

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