/* Basic Reset */

/* --- A4 Paper Edit Window Styles --- */
.a4-paper-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin: 2rem 0;
  width: 100%;
}
/* Document container */
.document-container {
    background: white;
    padding: 0;
    min-height: 100vh;
    overflow-y: auto;
    margin: 0;
    width: 100%;
}

/* A4 Paper Styling */
.a4-paper {
    width: 21cm;
    min-height: 29.7cm;
    max-width: 100%;
    background: white;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    page-break-after: always;
    break-after: page;
    box-shadow: none;
    border: none;
}

/* Content area */
.document-content {
    min-height: 100%;
    position: relative;
    background: white;
    outline: none;
    padding: 20px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: left !important;
}

/* Remove bullet points from all lists */
.document-content ul,
.document-content ol,
.document-content li {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Ensure all text is left-aligned */
.document-content * {
    text-align: left !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Page controls */
.page-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-controls button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-controls button:hover {
    background: #f5f5f5;
}

/* Page numbers */
.page-number {
    position: absolute;
    bottom: 1.5cm;
    right: 2cm;
    color: #666;
    font-size: 12px;
}

/* Print-specific styles */
@media print {
    .a4-paper {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        border-radius: 0;
        width: 100%;
        height: 100%;
    }
    
    /* Hide UI elements during print */
    .toolbar, .export-dropdown {
        display: none !important;
    }
}
.page-number {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  text-align: right;
  font-size: 0.9rem;
  color: #666;
  user-select: none;
  pointer-events: none;
  font-family: Arial, sans-serif;
  background: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.a4-paper .document-content {
  text-align: left;
}
.a4-paper .document-content {
  text-align: left;
  line-height: 1.5;
  color: #333;
  font-size: 12pt;
  font-family: 'Times New Roman', Times, serif;
  min-height: 100%;
  outline: none;
  transition: all 0.2s ease;
}

/* Editing mode styles */
.a4-paper .document-content.editing {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.a4-paper .document-content:focus {
  outline: none;
}

/* Make sure toolbar is always on top but export menu is above it */
.toolbar {
  position: relative;
  z-index: 100;
}

/* Export dropdown menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  z-index: 1000; /* Higher than toolbar */
  display: none;
  min-width: 160px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-top: 0.25rem;
  padding: 0.25rem 0;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: #1a202c;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f7fafc;
}

.a4-paper .document-content * {
  text-align: left !important;
  max-width: 100%;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Answer styling */
.a4-paper .answer {
  display: block;
  margin: 0.5em 0 1em 0;
  padding: 0.75em 1em;
  background: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-style: normal;
  position: relative;
  color: #111;
}

/* Remove bullets from answers */
.a4-paper .answer,
.a4-paper .answer li,
.a4-paper .answer ul,
.a4-paper .answer ol {
  list-style-type: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* Page break handling */
@media print {
  .a4-paper {
    margin: 0;
    padding: 2cm;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  body, html {
    background: white;
    margin: 0;
    padding: 0;
  }
  
  .a4-paper-container {
    padding: 0;
    margin: 0;
  }
}
.a4-paper .document-content ul, .a4-paper .document-content ol {
  list-style: none;
  margin-left: 0;
  padding-left: 1.2em;
}
.a4-paper .document-content li {
  text-align: left;
  margin-left: 0;
  padding-left: 0;
}

.document-content[contenteditable="true"] {
  outline: 2px solid #6366f1;
  background: #f9f9ff;
}

.doc-title-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}
.doc-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #222;
  background: none;
  border: none;
  text-align: center;
  outline: none;
  width: 100%;
  margin: 0;
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.toolbar-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
}
.toolbar-btn:hover, .toolbar-btn:focus {
  background: #eaeaff;
  border-color: #6366f1;
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.2rem 0 0.5rem 0;
}
.action-btn {
  background: #fff;
  color: #222;
  border: 1.5px solid #222;
  border-radius: 4px;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, border 0.16s, color 0.16s;
  box-shadow: none;
}
.action-btn:hover, .action-btn:focus {
  background: #f0f0f0;
  color: #111;
  border-color: #111;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: #6366f1;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: #6366f1;
}

.auth-btn, .btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: white;
    color: #6366f1;
    border: 2px solid #6366f1;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 70px);
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 0;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
}

/* Dark mode: homepage hero headline readable */
:root[data-theme="dark"] .hero-content h1 {
  color: #ffffff !important;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.feature-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Dark mode: process steps box black with white text */
:root[data-theme="dark"] .feature-preview {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
}
:root[data-theme="dark"] .feature-preview .arrow,
:root[data-theme="dark"] .feature-preview > div {
  color: #ffffff !important;
}

/* Upload Area */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
