/* Word Morph Game Styles */

/* Loading Indicator */
.wm-loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
}

.wm-loading-indicator .spinner-border {
  width: 3rem;
  height: 3rem;
}

.wm-loading-text {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 500;
}

/* Button States */
.btn-warning:disabled,
.btn-warning.disabled {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(50%);
}

/* Message Area */
#wm-message-area {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: 300px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#wm-message-area.show {
  opacity: 1;
}

/* Game Sections */
#wm-setup-section,
#wm-play-section,
#wm-game-over-section {
  transition: opacity 0.3s ease;
}

/* Word Display */

/* Game Container */
.word-morph-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Word Display */
.word-display {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word-display h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
    letter-spacing: 2px;
}

/* Word Path */
#wordPath {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.word-path-step {
    padding: 8px 12px;
    margin: 5px 0;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.word-path-step:hover {
    background-color: #dee2e6;
    transform: translateX(5px);
}

/* Input Area */
.input-group {
    max-width: 400px;
    margin: 0 auto 20px;
}

#wordInput {
    font-size: 1.2rem;
    text-align: center;
    text-transform: lowercase;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

/* Progress Bar */
.progress {
    height: 10px;
    margin: 15px 0;
    border-radius: 5px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Game Status */
#gameStatus {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* Feedback Messages */
#wordFeedback {
    min-height: 24px;
    margin: 10px 0;
    font-weight: 500;
}

.text-success {
    color: #198754;
}

.text-error {
    color: #dc3545;
}

.text-info {
    color: #0dcaf0;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .word-display h2 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #wordInput {
        border-radius: 4px 4px 0 0 !important;
    }
    
    #submitWordBtn {
        border-radius: 0 0 4px 4px !important;
        width: 100%;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        margin: 5px 0;
        width: 100%;
        max-width: 200px;
    }
}

/* Animation for word transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.word-path-step {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Arrow between words */
.arrow-down {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #6c757d;
    margin: 10px auto;
    position: relative;
}

.arrow-down::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(108, 117, 125, 0); }
    100% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0); }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(13, 110, 253, 0.3);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge styles for optimal path */
.badge {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5em 0.8em;
    margin: 0 5px 5px 0;
    display: inline-block;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .word-display,
    #gameStatus {
        background-color: #2d2d2d;
        color: #f8f9fa;
    }
    
    #wordPath {
        background-color: #1e1e1e;
        border-color: #444;
    }
    
    .word-path-step {
        background-color: #333;
        color: #f8f9fa;
    }
    
    .modal-content {
        background-color: #2d2d2d;
        color: #f8f9fa;
    }
    
    .modal-header,
    .modal-footer {
        background-color: #252525;
        border-color: #444;
    }
    
    .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }
}
