/**
 * Fill-in-Blank Mode Styles
 * UI for simplified single-word definition submissions
 */

/* Mode Selector */
.submission-mode-selector {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.mode-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #667eea;
}

.mode-option:has(input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.mode-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 13px;
    color: #666;
}

/* Fill-in-Blank Container */
.fill-blank-container {
    margin: 16px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.fill-blank-challenge {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fill-blank-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Template Display */
.fill-blank-template {
    padding: 16px;
    background: #f9f9ff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.blank-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Input Group */
.fill-blank-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fill-blank-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.fill-word-input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.fill-word-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fill-word-input.valid {
    border-color: #28a745;
    background: #f0fff4;
}

.fill-word-input.invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

.fill-word-hint {
    font-size: 12px;
    color: #666;
}

/* Live Preview */
.fill-blank-preview {
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.fill-blank-preview h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    min-height: 50px;
}

/* Submit Button */
.fill-blank-challenge .btn {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.fill-blank-challenge .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fill-blank-challenge .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fill-blank-challenge .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error State */
.fill-blank-error {
    padding: 16px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 14px;
    text-align: center;
}

/* Toast Notifications */
.fill-blank-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: white;
    color: #333;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 90%;
}

.fill-blank-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fill-blank-toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.fill-blank-toast-error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.fill-blank-toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .submission-mode-selector {
        flex-direction: column;
    }

    .fill-blank-container {
        padding: 16px;
    }

    .fill-blank-title {
        font-size: 16px;
    }

    .fill-blank-template {
        font-size: 14px;
        padding: 12px;
    }

    .fill-word-input {
        font-size: 14px;
    }

    .preview-text {
        font-size: 14px;
    }

    .fill-blank-challenge .btn {
        width: 100%;
        align-self: stretch;
    }
}

/* Small Screens */
@media (max-width: 480px) {
    .mode-label {
        font-size: 14px;
    }

    .mode-desc {
        font-size: 12px;
    }

    .fill-blank-container {
        padding: 12px;
    }

    .fill-blank-template {
        font-size: 13px;
    }

    .fill-word-input {
        padding: 10px;
    }

    .fill-blank-toast {
        top: 60px;
        font-size: 13px;
        padding: 10px 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .submission-mode-selector {
        background: #2d2d2d;
        border-color: #444;
    }

    .mode-option {
        background: #1a1a1a;
        border-color: #444;
    }

    .mode-option:hover {
        background: #2a2a3a;
    }

    .mode-label {
        color: #f5f5f5;
    }

    .mode-desc {
        color: #bbb;
    }

    .fill-blank-container {
        background: #2d2d2d;
    }

    .fill-blank-title {
        color: #f5f5f5;
    }

    .fill-blank-template {
        background: #1a1a1a;
        border-color: #444;
        color: #f5f5f5;
    }

    .fill-blank-input-group label {
        color: #f5f5f5;
    }

    .fill-word-input {
        background: #1a1a1a;
        border-color: #444;
        color: #f5f5f5;
    }

    .fill-word-hint {
        color: #bbb;
    }

    .fill-blank-preview {
        background: #1a1a1a;
        border-color: #444;
    }

    .fill-blank-preview h5 {
        color: #bbb;
    }

    .preview-text {
        color: #f5f5f5;
    }
}
