/* Frontend styles for Omni Uzupełnij zdania */
:root {
  --primary: #4caf50;
  --primary-dark: #45a049;
  --bg: #f9f9fc;
  --card-bg: #ffffff;
  --text: #333333;
  --success: #34c759;
  --error: #ff3b30;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.omni-uz-game-container {
  max-width: 960px;
  margin: 40px auto;
  padding: 30px 24px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: omni-uz-fade 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes omni-uz-fade {
  to { opacity: 1; }
}

.omni-uz-game-container h2 {
  text-align: center;
  margin: 0 0 10px;
  font-weight: 600;
}

.omni-uz-game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 10px 20px;
  margin-bottom: 24px;
  min-height: 48px;
}
.omni-uz-bar-timer {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  flex: 1;
  text-align: left;
}
.omni-uz-bar-counter {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  flex: 1;
  text-align: center;
}
.omni-uz-bar-fullscreen {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.omni-uz-page-info {
  text-align: center;
  margin-bottom: 16px;
  font-weight: 600;
}

.omni-uz-timer {
  text-align: center;
  font-size: 16px;
  margin-bottom: 10px;
}

/* Word options */
.omni-uz-options-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.omni-uz-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto 24px;
}

.omni-uz-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef1ff;
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  user-select: none;
  text-align: center;
  min-width: 100px;
  touch-action: none;
}

.omni-uz-option:active {
  cursor: grabbing;
}

.omni-uz-option.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.omni-uz-option.placed {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.omni-uz-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.omni-uz-option.selected {
  background: #e5efff;
  border: 2px solid #4a8eff;
  font-weight: bold;
}

.omni-uz-option.correct {
  background: #e7f6e7;
  border-color: #60c860;
}

.omni-uz-option.incorrect {
  background: #ffe8e8;
  border-color: #ff7070;
}

/* Sentences */
.omni-uz-sentence {
  margin-bottom: 30px;
  font-size: 18px;
  line-height: 1.4;
}

.omni-uz-sentence-content {
  background: #f8f9fd;
  border-radius: 15px;
  padding: 25px;
  margin: 0 auto 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  text-align: center;
  font-size: 20px;
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}

.omni-uz-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  height: 50px;
  border: 2px dashed #6c90e0;
  border-radius: 14px;
  margin: 0 8px;
  padding: 0 15px;
  transition: all 0.25s ease;
  color: #4a6bbd;
  font-weight: bold;
  vertical-align: middle;
  position: relative;
  background: rgba(108, 144, 224, 0.05);
}

.omni-uz-blank.filled {
  border-style: solid;
  background: #f0f5ff;
}

.omni-uz-blank.highlight {
  border-color: #4a8eff;
  background: rgba(74, 142, 255, 0.1);
}

.omni-uz-blank-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.omni-uz-blank-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: #ff6b6b;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
}

.omni-uz-blank:hover .omni-uz-blank-remove {
  opacity: 1;
}

.omni-uz-text-before, .omni-uz-text-after {
  font-size: 18px;
  color: #333;
}

/* Additional responsive styles */
@media (max-width: 768px) {
  .omni-uz-sentence-content {
    padding: 15px;
    font-size: 18px;
  }
  
  .omni-uz-blank {
    min-width: 100px;
    height: 40px;
    margin: 0 4px;
  }
}

/* Controls */
.omni-uz-action-button {
  display: block;
  margin: 30px auto 0;
  padding: 12px 28px;
  font-size: 16px;
  border: none;
  border-radius: 50px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
}

.omni-uz-action-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

#omni-game #omni-popup {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

#omni-game #omni-popup.show {
  opacity: 1;
  pointer-events: auto;
}

#omni-game #omni-popup .omni-uz-popup-inner {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 32px #2222;
  padding: 32px 30px 26px;
  min-width: 280px;
  max-width: 90vw;
  text-align: center;
  animation: omni-uz-popup-in 0.5s cubic-bezier(.6,2,.4,1);
}

@keyframes omni-uz-popup-in {
  0% { transform: scale(.85) translateY(32px); opacity:0; }
  100% { transform: scale(1) translateY(0); opacity:1; }
}

#omni-game #omni-popup .omni-uz-popup-title {
  font-size: 2.1em;
  font-weight: 700;
  color: #4f883d;
  margin: 0 0 10px;
}

#omni-game #omni-popup .omni-uz-popup-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
  text-align: left;
}

#omni-game #omni-popup .omni-uz-popup-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.05em;
  color: #111827;
}

#omni-game #omni-popup .omni-uz-popup-summary-label {
  font-weight: 600;
}

#omni-game #omni-popup .omni-uz-popup-summary-value {
  font-weight: 700;
  color: #4f883d;
}

#omni-game #omni-popup .omni-uz-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#omni-game #omni-popup .omni-uz-popup-btn {
  background: #4f883d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 30px;
  font-size: 1.05em;
  cursor: pointer;
  box-shadow: 0 1px 4px #4f883d33;
  transition: background .2s;
}

#omni-game #omni-popup .omni-uz-popup-btn:hover {
  background: #6bb94a;
}

#omni-game #omni-popup .omni-uz-popup-btn--outline {
  background: #fff;
  color: #4f883d;
  border: 2px solid #4f883d;
  box-shadow: none;
}

#omni-game #omni-popup .omni-uz-popup-btn--outline:hover {
  background: #f1f5f9;
}

#omni-game #omni-popup .omni-uz-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: #4a4a4a;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 3;
}

#omni-game #omni-popup .omni-uz-popup-close:hover {
  background: rgba(255,255,255,0.9);
}

.omni-save-result-section {
  max-width: 400px;
  margin: 18px auto 0;
  padding: 20px;
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  text-align: center;
}

.omni-save-checkbox-label {
  display: block;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  color: #4f883d;
}

.omni-save-checkbox-label input {
  margin-right: 8px;
  transform: scale(1.2);
  vertical-align: middle;
}

.omni-learner-name-field {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.omni-learner-name-field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  text-align: center;
}

.omni-learner-name-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.45;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 54px;
}

.omni-learner-name-input:focus {
  outline: none;
  border-color: #4f883d;
  box-shadow: 0 0 0 3px rgba(79, 136, 61, 0.15);
}

.omni-learner-name-input:read-only,
.omni-learner-name-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

.omni-save-result-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  margin: 8px 0 12px;
  background: linear-gradient(135deg, #4f883d 0%, #3e6c31 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.omni-save-result-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 136, 61, 0.3);
}

.omni-save-result-btn.saved {
  background-color: #4f883d !important;
  cursor: default;
}

.omni-save-result-btn:disabled {
  opacity: 0.7;
}

.omni-privacy-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: #1e1e1e;
  font-style: italic;
  text-align: center;
}

.omni-save-result-message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
}

.omni-save-result-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.omni-save-result-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 600px) {
  .omni-save-result-section {
    max-width: 100%;
    padding: 15px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .omni-uz-sentence {
    font-size: 16px;
  }
  .omni-uz-blank {
    width: 110px;
    height: 44px;
  }
}

/* Divi 4 and Divi 5 Compatibility */
.et-db #et-boc .et-l .omni-uz-game-container,
.et-db #et-boc .et-l .omni-uz-game-container * {
  box-sizing: border-box;
}

.et-db #et-boc .et-l .omni-uz-game-container h2 {
  padding-bottom: 10px;
}

.et-db #et-boc .et-l .omni-uz-action-button {
  line-height: 1.5;
  font-size: 16px;
}

/* Fix for shadows in Divi */
.et-db #et-boc .et-l .omni-uz-game-container {
  overflow: visible !important;
}
