/* Modern responsive styles for eSign app */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #fafafa;
  color: #222;
}

.app-container {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  height: calc(100vh - 40px); /* use available viewport height */
  box-sizing: border-box;
}

.left {
  flex: 0 0 40%;
  overflow: auto;
  padding-right: 10px;
}

.right {
  flex: 1 1 60%;
  border: 1px solid #e0e0e0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  background: #fff;
}

.preview-frame {
  width: 100%;
  flex: 1 1 auto; /* grow to fill right column */
  border: none;
}

.no-preview {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-style: italic;
}

label { display:block; margin-top:10px; }

/* Remove top margin for file info label so it aligns with its value inside the flex row */
#fileInfo label { display:inline-block; margin-top:0; }

/* Controls row: keep select and button side-by-side and top-aligned */
.controls-row { display:flex; gap:8px; align-items:flex-start; }
.controls-row > div { display:flex; flex-direction:column; }
.controls-row > div:first-child { flex:1 1 auto; }
.controls-row > div:last-child { flex:0 0 auto; }

@media (max-width: 900px) {
  .app-container { flex-direction: column; height: auto; }
  .left, .right { flex: initial; }
  .preview-frame { height: 480px; }
}

/* Standard button styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 20px;
  height: 32px;
  border: 1px solid #cfcfcf;
  background: #f5f5f5;
  color: #222;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover { background: #eee; }

/* Make select and button same height inside controls row */
.controls-row select,
.controls-row .btn {
  height: 32px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 20px;
  padding: 6px 12px;
}

.controls-row select { -webkit-appearance: none; appearance: none; }

/* Selected files table styles */
#selectedFilesWrapper { overflow-x: auto; }
.file-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d6e3f0;
  background: #fff;
}
.file-table th, .file-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef3f8;
  text-align: left;
  font-size: 14px;
}
.file-table th {
  background: #e8f4ff; /* light blue */
  color: #073763;
  font-weight: 600;
  border-bottom: 2px solid #d0e6ff;
}
.file-table th:first-child { border-top-left-radius: 6px; }
.file-table th:last-child { border-top-right-radius: 6px; }

@media (max-width: 600px) {
  .file-table th, .file-table td { padding: 8px 10px; font-size: 13px; }
}

/* Stronger upload-table rules to ensure alternating row backgrounds are visible */
table.file-table.upload-table { border-collapse: separate; border-spacing: 0; border: 1px solid #007bff; }
table.file-table.upload-table td { border-bottom: none !important; }
table.file-table.upload-table tbody tr:nth-child(odd) td { background-color: #fafafa !important; }
table.file-table.upload-table tbody tr:nth-child(even) td { background-color: #ffffff !important; }

/* Primary button (matches the 'Sign Documents' floating button) */
.btn-primary {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: 0 2px 4px rgba(13,110,253,0.12);
}
.btn-primary:hover { background: #084298; }

/* Disabled button appearance (light gray) */
.btn[disabled], .btn.btn-disabled {
  background: #e9ecef;
  color: #6c757d;
  border-color: #d6d8db;
  cursor: not-allowed;
  box-shadow: none;
}
