/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* General styles */
.puzzle-manager-puzzle-list,
.puzzle-manager-user-puzzles,
.puzzle-manager-completions {
    margin-bottom: 30px;
}

/* Puzzle grid */
.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 20px;
    margin-top: 20px;
}

.puzzle-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.puzzle-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.puzzle-item.puzzle-completed {
    border-color: #4CAF50;
    background-color: #f8fff8;
}

.puzzle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.puzzle-title {
    margin: 0;
    font-size: 1.2em;
}

.puzzle-status {
    background-color: #4CAF50;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
}

.puzzle-content {
    margin-bottom: 15px;
}

.puzzle-description {
    margin: 0;
    color: #666;
}

.puzzle-footer {
    display: flex;
    justify-content: flex-end;
}

button.complete-puzzle {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

button.complete-puzzle:hover {
    background-color: #0b7dda;
}

/* Puzzle sets */
.puzzle-sets-container {
    margin-top: 20px;
}

.puzzle-set {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.puzzle-set-header {
    margin-bottom: 15px;
}

.puzzle-set-progress {
    margin-top: 10px;
}

.progress-bar {
    height: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.9em;
    color: #666;
}

.puzzle-set-description {
    margin-bottom: 20px;
    color: #666;
}

.puzzle-set-puzzles h4 {
    margin-bottom: 15px;
}

/* Rewards */
.puzzle-reward {
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
}

.puzzle-reward.pending {
    color: #FF9800;
    font-style: italic;
}

/* Completions */
.completions-list {
    margin-top: 20px;
}

.completion-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.completion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.completion-date {
    font-size: 0.9em;
    color: #666;
}

.completion-meta {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.completion-user,
.completion-reward {
    margin-top: 5px;
}

.reward-info {
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
}

.reward-date {
    font-size: 0.9em;
    color: #666;
    margin-left: 5px;
}

.reward-pending {
    color: #FF9800;
    font-style: italic;
}


.puzzle-reward-content {
    background-color: #ffffff;
    border-style: solid;
    border-width: 0;
    background-clip: border-box;
    border-color: #7c7d7d;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-radius: 5px;
    padding: 10px;
}

/* Scanner Styles */
.scanner-container {
    position: relative;
    width: 360px;
    height: 360px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.scanner-container .content {
    width: 100%;
    height: 100%;
    position: relative;
}

.scanner-container .player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

.scanner-container .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.scanner-container .overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Responsive adjustments */
/* Puzzle solution shared styles (applies to both [puzzle_solution] and [location_puzzle_solution]) */
.puzzle-manager-solution-form {
    max-width: 900px;
    margin: 0 auto 24px auto;
    padding: 0 12px;
}

.puzzle-manager-solution-form .fl-heading {
    text-align: center;
    margin-bottom: 8px;
}

.puzzle-manager-solution-form .fl-callout .fl-callout-text {
    font-size: 16px;
    line-height: 1.5;
}

.solution-form {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
}

.solution-form .puzzle-description {
    display: block;
    margin-bottom: 12px;
    color: #374151;
}

/* Hint system */
.hint-section {
    margin-top: 10px;
}

.hint-buttons-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hint-button.button {
    background-color: #111827;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hint-button.inactive {
    opacity: .6;
}

.hints-container {
    display: none;
}

.hints-container .hint-item {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}

.hint-number {
    font-weight: 600;
    margin-bottom: 4px;
}

.solution-result {
    margin-top: 12px;
}
.solution-result .success {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 8px 10px;
    border-radius: 4px;
}
.solution-result .error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    border-radius: 4px;
}

/* Cryptex solution extras */
.timelabs-info-container .hint-item.timelabs-info {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .puzzle-grid {
        grid-template-columns: 1fr;
    }

    .completion-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .completion-date {
        margin-top: 5px;
    }

    .completion-meta {
        flex-direction: column;
    }

    .scanner-container {
        width: 100%;
        max-width: 360px;
        height: auto;
        aspect-ratio: 1/1;
    }
}
