/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Remove blue outline on button click */
button:focus,
input:focus,
select:focus,
textarea:focus,
.toolbar-btn:focus {
  outline: none !important;
  border-color: #cbd5e0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* Header Styles */
.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4a5568;
  text-decoration: none;
}

.breadcrumb {
  color: #718096;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: #4299e1;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Tool Header */
.tool-header {
  text-align: center;
  margin-bottom: 2rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tool-header h1 {
  font-size: 2.5rem;
  color: #2d3748;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.tool-header p {
  color: #718096;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Toolbar Styles */
.toolbar {
  background: white;
  border-radius: 12px 12px 0 0;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
}

.toolbar-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  padding-right: 0.75rem;
  border-right: 1px solid #e2e8f0;
}

.toolbar-group:last-child {
  border-right: none;
}

.toolbar-btn {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #4a5568;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}

.toolbar-btn:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.toolbar-btn:active {
  background: #e2e8f0;
}

.toolbar-btn.active {
  background: #4299e1;
  color: white;
  border-color: #3182ce;
}

/* Font Size Dropdown */
.font-size-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.font-size-select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

/* Editor Styles */
.editor-container {
  background: white;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.editor {
  width: 100%;
  min-height: 500px;
  border: none;
  padding: 2rem;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: #fafafa;
}

.editor:focus {
  background: white;
}

/* Find Dialog */
.find-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  min-width: 400px;
}

.find-dialog h3 {
  margin-bottom: 1rem;
  color: #2d3748;
}

.find-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.find-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

/* Status Bar */
.status-bar {
  background: #f7fafc;
  padding: 0.5rem 1rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #718096;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* File Input Hidden */
.file-input {
  position: absolute;
  left: -9999px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tool-header h1 {
    font-size: 2rem;
  }

  .toolbar {
    justify-content: center;
  }

  .toolbar-group {
    border-right: none;
    padding-right: 0;
    margin-bottom: 0.5rem;
  }

  .toolbar-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .find-dialog {
    min-width: 90vw;
    max-width: 400px;
  }

  .editor {
    padding: 1rem;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

@media (max-width: 480px) {
  .toolbar {
    padding: 0.5rem;
  }

  .toolbar-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    min-width: 32px;
  }

  .editor {
    min-height: 400px;
  }
}

/* Fullscreen Styles */
.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: white;
}

.fullscreen .editor {
  height: calc(100vh - 120px);
  min-height: calc(100vh - 120px);
}

/* Print Styles */
@media print {
  .toolbar,
  .status-bar,
  .header {
    display: none !important;
  }

  .editor {
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    font-family: "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.5;
    padding: 1in;
  }

  body {
    background: white !important;
  }
}

/* Loading Indicator */
.loading {
  display: none;
  color: #4299e1;
  font-size: 0.8rem;
}

.loading.active {
  display: inline-block;
}
