﻿/* Gap Fill Exercise Styles */

/* Resizable input functionality (copied from multi.css) */
*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

/* Success Message Styles */
.success-message {
  text-align: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-bottom: 30px;
}

.success-message h2 {
  color: #28a745;
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: 600;
}

.success-message p {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

.url-display {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 2px solid #28a745;
  border-radius: 6px;
  display: inline-block;
}

.activity-url {
  color: #007bff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  word-break: break-all;
}

.activity-url:hover {
  color: #0056b3;
  text-decoration: underline;
}

.action-buttons {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-buttons .create_button {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: white;
  border: 2px solid #007bff;
  background: #007bff;
  cursor: pointer;
  font-size: 16px;
}

.action-buttons .create_button.secondary {
  background: #6c757d;
  border: 2px solid #6c757d;
  color: white;
}

.action-buttons .create_button:hover {
  background: #0056b3;
  border-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.action-buttons .create_button.secondary:hover {
  background: #5a6268;
  border-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Responsive Design for Success Message */
@media (max-width: 480px) {
  .success-message {
    padding: 20px 15px;
  }
  
  .success-message h2 {
    font-size: 24px;
  }
  
  .activity-url {
    font-size: 16px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-buttons .create_button {
    width: 100%;
    max-width: 300px;
  }
}

/* Page header */
.page-header {
    padding: 30px 0;
    margin-bottom: 30px;
}

.page-header h1 {
    color: #495057;
    margin-bottom: 25px;
    font-size: 2.2em;
    text-align: center;
}

.buttonBar {
    margin-bottom: 20px;
}

.nav-button {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-button:hover {
    background: #0056b3;
    text-decoration: underline;
}

.version-notice {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 4px solid #007bff;
}

.workflow-steps {
    margin: 20px 0;
}

.step-item {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.user-status {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    display: flex;
    align-items: center;
}

.logged-in {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.logged-out {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.status-icon {
    font-weight: bold;
    margin-right: 10px;
}

/* Form sections */
.exercise-creator {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.instruction-text {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.example-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.example-container h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
}

.create_formhead {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.create_textinput {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    margin-bottom: 15px !important;
    box-sizing: border-box;
}

.create_textinput:focus {
    border-color: #007bff;
    outline: none;
}

.create_textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box;
}

.create_textarea:focus {
    border-color: #007bff;
    outline: none;
}

/* Gap fill input styling - resizable functionality */
#exerciseContainer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: left;
      -ms-flex-pack: left;
          justify-content: left;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  margin-bottom: 20px;
  font-size: 20px;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

#exerciseContainer button,
#exerciseContainer input[type="button"],
#exerciseContainer input[type="submit"] {
  font-size: 20px;
}

.inputsDiv {
  width: auto;
}

.input-sizer {
  display: -ms-inline-grid;
  display: inline-grid;
  vertical-align: top;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  border: 0;
  padding: 0.1em 0.3em;
  margin-right: 5px;
  position: relative;
  min-width: 120px;
  flex: 1;
}

.input-sizer.stacked {
  padding: 0.5em;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
}

.input-sizer.stacked::after,
.input-sizer.stacked input,
.input-sizer.stacked textarea {
  -ms-grid-row: 2;
  -ms-grid-column: 1;
  grid-area: 2/1;
}

.input-sizer::after,
.input-sizer input,
.input-sizer textarea {
  width: auto;
  min-width: 1em;
  -ms-grid-row: 1;
  -ms-grid-column: 2;
  grid-area: 1/2;
  font: inherit;
  padding: 0.1em;
  margin: 0;
  resize: none;
  background: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
}

.input-sizer span {
  padding: 0.25em;
}

.input-sizer::after {
  content: attr(data-value) " ";
  visibility: hidden;
  white-space: pre-wrap;
}

.input-sizer:focus-within {
  outline: solid 1px #007bff;
}

.input-sizer:focus-within > span {
  color: #007bff;
}

.input-sizer:focus-within textarea:focus,
.input-sizer:focus-within input:focus {
  outline: none;
}

.input-sizer > span {
  text-transform: uppercase;
  font-size: 1em;
  font-weight: bold;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

/* Override the problematic border from multi.css */
.input-sizer {
  border: 2px solid #ddd !important;
  border-radius: 5px !important;
  background: white !important;
}

.input-sizer input {
  border: none !important;
  background: transparent !important;
  padding: 8px !important;
  font-size: 16px !important;
  min-width: 120px !important;
}

.input-sizer input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Make all input fields the same length */
#exerciseContainer .input-sizer {
    flex: 1;
    min-width: 150px;
}

#exerciseContainer .input-sizer input {
    min-width: 150px;
}

/* Input labels */
.input-labels {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 10px;
}

.input-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

/* Buttons */
.create_button {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    line-height: 1.2;
    height: auto;
    vertical-align: middle;
}

.create_button:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.create_button.secondary {
    background: #6c757d;
}

.create_button.secondary:hover {
    background: #545b62;
}

/* Edit button styling - very compact */
.editBtn {
    background: #007bff !important;
    color: white !important;
    border: none !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    transition: background 0.3s !important;
    text-decoration: none !important;
    display: inline-block !important;
    margin: 0 !important;
    line-height: 1 !important;
    height: 20px !important;
    vertical-align: middle !important;
    width: auto !important;
}

.editBtn:hover {
    background: #0056b3 !important;
    color: white !important;
    text-decoration: none !important;
}

/* Delete button styling */
.deleteBtn {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    transition: background 0.3s !important;
    text-decoration: none !important;
    display: inline-block !important;
    margin: 0 0 0 5px !important;
    line-height: 1 !important;
    height: 20px !important;
    vertical-align: middle !important;
    width: auto !important;
}

.deleteBtn:hover {
    background: #c82333 !important;
    color: white !important;
    text-decoration: none !important;
}

/* Update button styling */
.updateBtn {
    background: #28a745 !important;
    color: white !important;
    border: 2px solid #28a745 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    height: auto !important;
    vertical-align: middle !important;
    width: auto !important;
}

.updateBtn:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px) !important;
    color: white !important;
    text-decoration: none !important;
}

/* Add line button styling - similar to multi/create add sentence button */
#addGapfill[hidden] {
    display: none !important;
}

#addGapfill {
    background-color: #28a745 !important;
    color: white !important;
    border: 2px solid #28a745 !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    margin: 15px 0 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
}

#addGapfill:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px) !important;
    color: white !important;
}

.create-section {
    text-align: center;
    margin-top: 30px;
}

/* Error messages */
.error {
    color: #dc3545;
    text-align: center;
    margin: 15px 0;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .step-item {
        display: block;
        margin-bottom: 10px;
    }
    
    .action-buttons .create_button {
        display: block;
        margin-bottom: 10px;
    }
    
    #exerciseContainer {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
    }
    
    .input-sizer {
        width: 100%;
        margin: 8px 0;
        min-width: 100%;
    }
    
    .input-sizer input {
        min-width: 100%;
    }
    
    #exerciseContainer .input-sizer {
        flex: 1;
        min-width: 100%;
    }
    
    #exerciseContainer .input-sizer input {
        min-width: 100%;
    }
    
    .input-labels {
        flex-direction: column;
        gap: 3px;
        padding: 0 8px;
    }
    
    .input-label {
        text-align: left;
        font-size: 13px;
    }

    .gap-item-row {
        grid-template-columns: 36px 1fr;
    }

    .gap-fields {
        grid-template-columns: 1fr;
    }

    .gap-row-labels {
        display: none;
    }

    .gap-item-row .deleteBtn {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* Bulk paste + stable rows + preview (gapfill) */
.bulk-format-list {
    margin: 0 0 16px 18px;
    color: #555;
    line-height: 1.6;
}

.bulk-format-list code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.92em;
}

.bulk-paste {
    min-height: 120px;
    font-family: inherit;
    font-size: 16px;
}

.paste-example {
    margin: 0 0 14px;
    color: #444;
}

.paste-example-text {
    background: #f1f3f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.other-formats {
    margin: 14px 0 8px;
    color: #555;
}

.other-formats summary {
    cursor: pointer;
    color: #007bff;
    font-weight: 500;
}

.review-block {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e9ecef;
}

.review-heading {
    margin: 0 0 10px;
    font-size: 1.15em;
    color: #333;
}

.bulk-actions,
.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.create_button.secondary,
.deleteBtn.secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.create_button.secondary:hover,
.deleteBtn.secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.bulk-status {
    margin-top: 10px;
    color: #28a745;
    min-height: 1.2em;
}

.bulk-status-error {
    color: #dc3545;
}

.gap-row-labels {
    display: grid;
    grid-template-columns: 40px 1fr 1.2fr 1fr 80px;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gap-item-row {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

/* Match exercise sentence numbers: equal width/height so border-radius:50% is a circle */
.gap-item-row .create_roundNum,
.gap-row-num,
.preview-row .create_roundNum {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gap-fields {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 8px;
}

.gap-field {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
}

.gap-field:focus {
    border-color: #007bff;
    outline: none;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.preview-section .preview-open-btn {
    margin-bottom: 12px;
}

.preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.preview-header h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.preview-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.student-preview {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.preview-title {
    margin: 0 0 8px;
    font-size: 1.4em;
}

.preview-description {
    margin: 0 0 16px;
    color: #666;
}

.ai-help summary {
    cursor: pointer;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.ai-help-body {
    margin-top: 12px;
}

.ai-help-steps {
    margin: 0 0 16px 20px;
    line-height: 1.7;
    color: #444;
}

.ai-help-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

#copyAiPromptBtn {
    margin-top: 10px;
}

.create-section {
    text-align: center;
    margin: 20px 0 40px;
}

.create_textarea {
    font-family: inherit;
}

.ai-api-hint {
    margin: 16px 0 0;
    padding: 0;
    font-size: 0.8em;
    line-height: 1.4;
    font-weight: normal;
    color: #6c757d;
    background: none;
    border: none;
}

.ai-api-hint a {
    color: #6c757d;
    text-decoration: underline;
}

.api-docs h3 {
    margin-top: 22px;
    color: #333;
} 