/* word-counter.css */
:root {
    --bg-page: #F8FAFC;
    --bg-hero-start: #F0FDFA;
    --bg-hero-end: #F1F5F9;
    --bg-card: #FFFFFF;
    --primary-accent: #0D9488;
    --primary-accent-light: #CCFBF1;
    --text-dark: #1E293B;
    --text-medium: #475569;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --error-bg: #FEF2F2;
    --error-text: #DC2626;
    --warning-bg: #FFFBEB;
    --warning-text: #B45309;
    --success-bg: #ECFDF5;
    --success-text: #065F46;
    --upload-bg: #F8FAFC;
    --upload-border: #E2E8F0;
    --upload-active: #CCFBF1;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-medium);
    line-height: 1.6;
    overflow-x: hidden;
  }
  
  h1, h2, h3, h4 {
    color: var(--text-dark);
    line-height: 1.2;
    font-weight: 600;
  }
  
  h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
  }
  
  h2.section-title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: 1.25rem;
  }
  
  h3.subsection-title {
    font-size: clamp(1rem, 3vw, 1.1rem);
    margin-bottom: 0.75rem;
  }
  
  /* Navigation */
  .navbar {
    background-color: var(--bg-card);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
  }
  
  .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem clamp(0.75rem, 3vw, 1rem);
  }
  
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .nav-logo {
    height: 32px;
    width: auto;
  }
  
  .brand-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
  }
  
  /* Navigation Toggle */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 1002;
  }
  
  .nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  /* Navigation Slider */
  .nav-slider {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background-color: var(--bg-card);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
  }
  
  .nav-slider.active {
    right: 0;
  }
  
  .slider-content {
    padding: 1.5rem;
    height: 100%;
  }
  
  .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .slider-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
  }
  
  .slider-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .slider-link {
    display: block;
    padding: 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
  }
  
  .slider-link:hover, .slider-link.active {
    background-color: var(--primary-accent-light);
    color: var(--primary-accent);
  }
  
  /* Overlay when slider is open */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Layout */
  main {
    padding: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
  
  .card {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    padding: clamp(0.75rem, 3vw, 1.25rem);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    width: 100%;
  }
  
  .main-card {
    border-top: 4px solid var(--primary-accent);
  }
  
  .main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }
  
  @media (min-width: 768px) {
    main {
      padding: 1rem;
    }
    .main-grid {
      grid-template-columns: 1fr 1fr;
      gap: 2rem;
    }
  }
  
  /* Form Styles */
  .form-section {
    width: 100%;
  }
  
  .input-group {
    margin-bottom: 1.5rem;
  }
  
  .form-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 0.875rem);
    font-weight: 500;
    margin-bottom: 0.5rem;
  }
  
  .form-section input, .form-section select, .form-section textarea {
    width: 100%;
    padding: clamp(0.5rem, 2vw, 0.75rem);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    background-color: var(--bg-page);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
  }
  
  .form-section input:focus, .form-section select:focus, .form-section textarea:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--primary-accent-light);
  }
  
  /* Text Area */
  .text-area-container {
    margin-bottom: 1.5rem;
  }
  
  #text-input {
    width: 100%;
    min-height: 200px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
  }
  
  .text-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
  
  .text-action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-medium);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .text-action-button:hover {
    background-color: var(--primary-accent-light);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
  }
  
  /* Results Section */
  .results-section {
    width: 100%;
  }
  
  .results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }
  
  /* Stats Grid */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
  }
  
  .stat-box {
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: var(--bg-page);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
  }
  
  .stat-box.primary {
    background-color: var(--primary-accent-light);
    border-color: var(--primary-accent);
  }
  
  .stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
    color: var(--text-medium);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Reading Level Section */
  .reading-level-section {
    width: 100%;
  }
  
  .reading-level-card {
    background-color: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 100%;
  }
  
  .level-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .level-score {
    text-align: center;
    min-width: 80px;
  }
  
  .level-score span {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-accent);
    line-height: 1;
  }
  
  .level-score small {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .level-description h4 {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
  }
  
  .level-description p {
    font-size: 0.875rem;
    color: var(--text-medium);
  }
  
  .level-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
  }
  
  .detail-label {
    font-size: 0.875rem;
    color: var(--text-medium);
  }
  
  .detail-value {
    font-weight: 600;
    color: var(--text-dark);
  }
  
  /* Target Items */
  .target-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .target-item:last-child {
    border-bottom: none;
  }
  
  .target-type {
    font-weight: 500;
    color: var(--text-dark);
  }
  
  .target-count {
    font-size: 0.875rem;
    color: var(--text-medium);
    background-color: var(--primary-accent-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
  }
  
  /* Message Boxes */
  .message-box {
    padding: clamp(0.5rem, 2vw, 0.75rem);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    width: 100%;
    animation: slideIn 0.3s ease-out;
  }
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .error-box {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-text);
  }
  
  /* Hero Section */
  .hero-section {
    padding: clamp(1.5rem, 5vw, 2.5rem) clamp(0.75rem, 3vw, 1rem) clamp(2rem, 5vw, 3.5rem);
    background-image: linear-gradient(120deg, var(--bg-hero-start), var(--bg-hero-end));
    text-align: center;
    width: 100%;
  }
  
  .hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 clamp(0.75rem, 3vw, 1rem);
  }
  
  .hero-text p {
    font-size: clamp(0.875rem, 3vw, 1.1rem);
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-button {
    display: inline-block;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
    background-color: var(--primary-accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .cta-button:hover {
    background-color: #0b7a6f;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  }
  
  /* Content Section */
  .content-section {
    padding: 0 clamp(0.75rem, 3vw, 1rem) clamp(2rem, 5vw, 3rem);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
  
  .content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  @media (min-width: 1024px) {
    .content-grid {
      grid-template-columns: 2fr 1fr;
      gap: 2rem;
    }
  }
  
  /* Info Items */
  .info-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .info-item h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
  }
  
  /* FAQ Items */
  .faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .faq-item h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
  }
  
  /* Tip Items */
  .tip-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .tip-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .tip-icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-accent-light);
    color: var(--primary-accent);
    border-radius: 0.5rem;
    flex-shrink: 0;
  }
  
  .tip-icon i {
    font-size: 1.25rem;
    margin-top: 0.5rem;
  }
  
  .tip-content h3 {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
  }
  
  .tip-content p {
    font-size: 0.875rem;
    color: var(--text-medium);
  }
  
  /* Privacy and Disclaimer Boxes */
  .privacy-notice, .disclaimer-box {
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
  }
  
  .privacy-notice {
    background-color: var(--success-bg);
    border: 1px solid var(--success-text);
  }
  
  .disclaimer-box {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-text);
  }
  
  .privacy-title, .disclaimer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
  }
  
  .privacy-text, .disclaimer-text {
    margin: 0;
    color: var(--text-medium);
  }
  
  /* Footer */
  .footer {
    background-color: var(--bg-card);
    padding: clamp(1.5rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1rem);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
  }
  
  .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
  
  .footer-links {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .footer-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
  }
  
  .footer-links a:hover {
    color: var(--primary-accent);
  }
  
  .footer .disclaimer {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 1rem;
  }
  
  /* Animations */
  .animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
  }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Input Help Text */
  .input-help {
    font-size: 0.875rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
  }
  
  /* Options Section */
  .options-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
  }
  
  /* Responsive Adjustments */
  @media (max-width: 767px) {
    .level-indicator {
      flex-direction: column;
      text-align: center;
      gap: 1rem;
    }
    
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .tip-item {
      flex-direction: column;
      text-align: center;
    }
    
    .tip-icon {
      align-self: center;
    }
  }
  
  @media (max-width: 480px) {
    .stats-grid {
      grid-template-columns: 1fr;
    }
    
    .text-actions {
      flex-direction: column;
    }
  }