﻿
/* Custom Register Maker Specific Styles */
.tool-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  min-height: 0;
  background: #f1f5f9;
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .tool-container {
    flex-direction: row;
  }
}

/* Sidebar Controls */
.controls-panel {
  width: 100%;
  min-height: 0;
  background: var(--card-bg, #ffffff);
  border-right: 1px solid var(--border-color, #e2e8f0);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .controls-panel {
    width: 400px;
    flex: 0 0 400px;
  }
}

.tool-header {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--primary-color, #2563eb);
}

.control-section {
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #fafafa;
}

.control-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 5px;
  color: #333;
}

.controls-panel label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  margin-top: 10px;
  color: #475569;
}

.controls-panel input[type="text"],
.controls-panel input[type="number"],
.controls-panel select {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mt-2 { margin-top: 15px; }

.checkbox-group {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group label {
  margin: 0;
  cursor: pointer;
}

/* Column Editor UI */
.col-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 30px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.remove-col-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  height: 34px;
}

.width-warning {
  font-size: 12px;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  margin-bottom: 10px;
}

.width-warning.error {
  background: #fee2e2;
  color: #991b1b;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  box-sizing: border-box;
}

.btn:hover { opacity: 0.9; }

.btn-primary {
  background: var(--primary-color, #2563eb);
  color: white;
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

.generate-btn {
  margin-top: 10px;
  font-size: 16px;
  padding: 15px;
}

.status-msg {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #059669;
}

/* Preview Panel */
.preview-panel {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #94a3b8;
  overflow: hidden;
}

.preview-header {
  flex: 0 0 auto;
  background: #334155;
  color: white;
  padding: 10px 20px;
  font-size: 14px;
}

/* Both horizontal and vertical scrolling */
.preview-scroll-area {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 40px;
  display: block;
  box-sizing: border-box;
}

/* The Paper */
.paper {
  background: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0 auto 30px auto;
}

.paper-border {
  position: absolute;
  border: 1px solid #000;
  pointer-events: none;
}

.paper-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  font-family: Helvetica, sans-serif;
}

.paper-subtitle {
  text-align: center;
  font-size: 12px;
  font-family: Helvetica, sans-serif;
  margin-bottom: 15px;
}

.paper-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: Helvetica, sans-serif;
}

.paper-table th,
.paper-table td {
  border: 1px solid #000;
  padding: 4px;
  font-size: 10px;
  overflow: hidden;
}

.paper-table th {
  background: #f8fafc;
  font-weight: bold;
}

.paper-footer-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-family: Helvetica, sans-serif;
  font-size: 10px;
}

/* Mobile Layout */
@media (max-width: 991px) {
  .tool-container {
    height: auto;
    min-height: calc(100vh - 65px);
    overflow: visible;
  }

  .controls-panel {
    max-height: 65vh;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .preview-panel {
    height: 75vh;
    min-height: 450px;
    flex: none;
  }

  .preview-scroll-area {
    padding: 20px;
  }
}
