:root {
  --background-color: #f8f9fe;
  --card-bg: #ffffff;
  --primary-text: #1F2937;
  --secondary-text: #4B5563;
  --accent-color: #635bff;
  --accent-hover: #5048e5;
  --accent-light: #f0f0ff;
  --border-color: #E5E7EB;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
  --font-family: 'Poppins', sans-serif;
  --brand-font: 'Poppins', sans-serif;
  --accent-gradient: linear-gradient(45deg, var(--accent-color), var(--accent-hover));
}

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

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--primary-text);
  line-height: 1.6;
}

#root {
  width: 100%;
}

.page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: rgba(248, 249, 254, 0.7);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.header-right {
    display: flex;
    align-items: center;
}

.header-cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.2);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.header-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(238, 90, 111, 0.3);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.logo-title {
    font-family: var(--brand-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-text);
    line-height: 1;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
}
.btn-primary {
    background-color: var(--accent-color);
    background-image: var(--accent-gradient);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-secondary {
    background-color: var(--card-bg);
    color: var(--primary-text);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--background-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
    width: 100%;
}

.main-content-full-width {
    flex-grow: 1;
    width: 100%;
}

.main-content > .card,
.main-content > .main-grid,
.main-content > .result-view-container {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 100%;
}

/* === NEW LANDING PAGE STYLES === */
.landing-page-section {
    padding: 100px 0;
}
.landing-page-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 65px); /* Adjust for header height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero .tagline {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0.95;
}
.hero .description {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 18px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(238, 90, 111, 0.3);
    border: none;
    cursor: pointer;
    margin: 10px;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(238, 90, 111, 0.4);
    background: linear-gradient(45deg, #ee5a6f, #ff6b6b);
}
.secondary-cta {
    background: transparent;
    border: 2px solid white;
}
.secondary-cta:hover {
    background: white;
    color: #667eea;
}

/* Floating Icons */
.floating-icons {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 1;
}
.icon {
    position: absolute;
    color: rgba(255,255,255,0.1);
    font-size: 24px;
    animation: float 20s infinite linear;
    user-select: none;
}

/* Features Section */
.features { background: white; }
.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}
.feature-card {
    text-align: center;
    padding: 40px 30px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.feature-card:hover { transform: translateY(-10px); }
.feature-icon { font-size: 3rem; margin-bottom: 20px; color: #667eea; }
.feature-card h3 { font-size: 1.5rem; margin-bottom: 15px; }

/* Stats Section */
.stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}
.stats h2 { font-size: 2.5rem; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.stat-item h3 { font-size: 3rem; font-weight: 700; margin-bottom: 10px; }
.stat-item p { font-size: 1.1rem; opacity: 0.9; }

/* How It Works Section */
.how-it-works { background: #f8f9fa; }
.how-it-works h2, .how-it-works .section-subtitle { text-align: center; }
.how-it-works h2 { font-size: 2.5rem; }
.section-subtitle { font-size: 1.2rem; color: #666; max-width: 600px; margin: 0 auto; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 60px;
}
.step { text-align: center; position: relative; }
.step-number {
    display: inline-block;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 60px;
    margin-bottom: 20px;
}
.step h3 { font-size: 1.5rem; }

/* Common Struggles */
.common-struggles { background: #f8f9fa; }
.common-struggles h2, .common-struggles .section-subtitle { text-align: center; }
.common-struggles h2 { font-size: 2.5rem; }
.common-struggles-list {
    margin-top: 40px;
}
.common-struggles-list ul {
    list-style: none;
    padding: 0;
    column-count: 4;
    column-gap: 30px;
}
.common-struggles-list li {
    padding: 8px 12px;
    margin-bottom: 12px;
    background-color: #f0f0ff;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-text);
    display: inline-block;
    width: 100%;
    text-align: center;
}

/* Final CTA */
.final-cta {
    padding: 100px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}
.final-cta h2 { font-size: 2.5rem; margin-bottom: 20px; }
.final-cta p { font-size: 1.3rem; margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; }
.final-cta .cta-button { font-size: 1.3rem; padding: 20px 50px; }
.final-cta .cta-subtitle { margin-top: 20px; opacity: 0.8; }

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: flex-start;
    max-width: 700px;
    margin: 0 auto;
}
.form-column header {
    text-align: left;
    margin-bottom: 2rem;
}
.form-column h1 {
    font-size: 2rem;
    font-weight: 700;
}
.form-column p {
    color: var(--secondary-text);
    font-size: 1.1rem;
}
.preview-column h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: left;
}

/* Form Styles */
.form-container { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
select.form-control, textarea.form-control, input.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #F9FAFB;
  color: var(--primary-text);
}
textarea.form-control::placeholder, input.form-control::placeholder {
  color: var(--secondary-text);
  opacity: 0.8;
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control:focus, textarea.form-control:focus, input.form-control:focus {
  outline: none;
  background-color: white;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}
.submit-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.advanced-toggle-button {
    margin-top: 1rem;
    text-align: center;
    color: var(--secondary-text);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.advanced-toggle-button:hover { color: var(--accent-color); }

/* Random Struggle */
.random-struggle-card { margin-top: 2rem; }
.random-struggle-card .submission-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.random-struggle-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Problems List */
.problems-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.problem-item {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.problem-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}
.problem-item details { padding: 1rem 1.25rem; }
.problem-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  width: 100%;
}
.problem-summary::-webkit-details-marker { display: none; }
.chevron-icon {
  color: var(--secondary-text);
  margin-left: auto;
  transition: transform 0.2s;
  padding-left: 0.5rem;
  flex-shrink: 0;
}
details[open] .chevron-icon { transform: rotate(180deg); }
.problem-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-hover);
  background-color: var(--accent-light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.problem-text { font-size: 1rem; color: var(--secondary-text); }
.problem-text strong { font-weight: 600; color: var(--primary-text); }
.problem-item, .random-struggle-card .submission-item {
    animation: slideInUp 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: calc(var(--i, 0) * 60ms);
}

/* Submissions List */
.submissions-list {
  list-style: none;
  padding-left: calc(48px + 1rem);
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.submission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--secondary-text);
}
.submission-text { flex-grow: 1; }
.submission-meta {
    font-style: italic;
    color: var(--secondary-text);
    opacity: 0.8;
    font-size: 0.9em;
    margin-left: 0.5em;
}
.more-less-button {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 0 0 0 0.5em;
  text-decoration: underline;
  font-size: 0.9em;
  vertical-align: baseline;
}
.more-less-button:hover { color: var(--accent-color); }
.upvote-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.upvote-button {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  width: 34px;
  height: 34px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-text);
}
.upvote-button:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.1);
}
.upvote-button.voted {
  background-color: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.upvote-button:disabled { cursor: default; }
.upvote-button:disabled:hover { transform: none; }
.upvote-count {
  font-weight: 600;
  color: var(--secondary-text);
  min-width: 2ch;
  text-align: right;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.upvote-count.visible { opacity: 1; }

/* Result View */
.result-view-container { max-width: 700px; margin: 0 auto; text-align: center; }
.result-view-container .submissions-list { padding-left: 0; }
.user-submission-header {
  background-color: var(--accent-light);
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid #dcd9ff;
}
.user-submission-header p {
  color: var(--accent-hover);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.user-submission-header h2 {
  font-size: 2rem;
  font-style: normal;
  font-weight: 700;
  color: var(--primary-text);
  margin-top: 0.5rem;
}
.result-summary {
  font-size: 1.5rem;
  color: var(--primary-text);
  padding: 1rem;
  margin-bottom: 2rem;
  font-weight: 500;
  position: relative;
}
.result-summary strong { color: var(--accent-color); font-weight: 700; font-size: 1.8rem; }
.similar-problems-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  text-align: left;
  font-weight: 600;
}
.no-submissions-msg {
    color: var(--secondary-text);
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}
.back-button { margin-top: 2rem; }

/* Loader */
.loader {
  width: 18px; height: 18px;
  border: 2px solid #FFF;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

/* Footer */
.page-footer {
    background: #333;
    color: white;
    padding: 60px 0 30px;
    text-align: center;
}
.page-footer h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.social-links { margin: 20px 0; }
.social-links a { color: white; font-size: 1.5rem; margin: 0 15px; transition: color 0.3s ease; text-decoration: none; }
.social-links a:hover { color: #ff6b6b; }
.copyright { margin-top: 20px; opacity: 0.7; font-size: 0.9rem; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* Confetti */
.confetti-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 100;
}
.confetti {
    position: absolute;
    width: 10px; height: 10px;
    background: #f00; /* Will be overridden by inline style */
    opacity: 0;
    animation: confetti-fall 3s ease-out forwards;
}
@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotateZ(0deg); opacity: 1; }
    100% { transform: translateY(400px) rotateZ(360deg); opacity: 0; }
}

@media (max-width: 1000px) {
    .common-struggles-list ul {
        column-count: 3;
    }
}
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero .tagline { font-size: 1.2rem; }
    .hero .description { font-size: 1rem; }
    .cta-button { padding: 15px 30px; font-size: 1rem; }
    .common-struggles-list ul {
        column-count: 2;
    }
}
@media (max-width: 600px) {
  .page-header { padding: 1rem; }
  .main-content { padding: 1rem; }
  .card { padding: 1.5rem; }
}
@media (max-width: 480px) {
    .logo-title {
        display: none;
    }
    .header-cta-button {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    .common-struggles-list ul {
        column-count: 1;
    }
}