:root {
  --primary-color: #1976d2;
  --secondary-color: #424242;
  --background-color: #f5f5f5;
  --card-background: #ffffff;
  --text-color: #212121;
}

body {
  font-family: "Roboto", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

nav {
  margin-top: 1rem;
}

.tab-button {
  background-color: transparent;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.tab-button.active {
  background-color: rgba(255, 255, 255, 0.2);
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#main-content {
  display: flex;
  gap: 1rem;
}

.left-column {
  flex: 1;
  max-width: 70%;
}

.right-sidebar {
  flex: 0 0 30%;
  max-width: 30%;
}

.card {
  background-color: var(--card-background);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  padding: 1rem;
  margin-bottom: 1rem;
}

.instructions {
  background-color: #e3f2fd;
}

#pdf-upload {
  margin-bottom: 1rem;
}

#page-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

#page-navigation button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
}

#page-navigation button:disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

#page-num {
  margin: 0 1rem;
}

#pdf-container {
  position: relative;
  width: 100%;
  height: 841px;
  border: 1px solid #ccc;
  margin-bottom: 1rem;
  overflow: hidden;
}

#pdf-preview {
  width: 100%;
  height: 100%;
  background-color: #f2f3fa;
}

/* 署名エリアのスタイルはJavaScript側で動的に設定されるため、
   CSSでの定義は不要（競合を避けるためコメントアウト）
#signature-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#signature-box {
  position: absolute;
  width: 60px;
  height: 60px;
  background-color: rgba(255, 0, 0, 0.3);
  border: 2px solid red;
  cursor: move;
  pointer-events: auto;
}
*/

.primary-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.primary-button:hover {
  background-color: #1565c0;
}

#command-display {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
  max-height: 300px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

input,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
}

.signature-preview {
  max-width: 100%;
  height: auto;
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f9f9f9;
}

.signature-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.help-text {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

input[type="file"] {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 1rem;
  width: 100%;
}

/* スナックバー */
#snackbar {
  visibility: hidden;
  min-width: 300px;
  max-width: 80%;
  margin-left: -40%;
  text-align: left;
  border-radius: 4px;
  padding: 1rem;
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 30px;
  font-size: 0.95rem;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

#snackbar.show {
  visibility: visible;
  animation: fadein 0.5s;
}

#snackbar.success {
  background-color: #4caf50;
}

#snackbar.error {
  background-color: #f44336;
}

@keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 0;
    opacity: 0;
  }
}
