/* --- AI DEEP DIVE STYLING (GOLDEN) --- */
.ai-deep-dive-btn {
    background: transparent;
    border: 2px solid #FFCF02;
    color: #FFCF02;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 207, 2, 0.2);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ai-deep-dive-btn:hover {
    background: #FFCF02;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 207, 2, 0.6);
    transform: translateY(-2px);
}

.ai-deep-dive-btn:active {
    transform: translateY(0);
}

.ai-deep-dive-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.ai-panel {
    margin-top: 15px;
    border: 1px solid #333;
    border-left: 4px solid #FFCF02;
    background: #18181b;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    color: #e4e4e7;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.ai-section-title {
    color: #FFCF02;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
    letter-spacing: 0.05em;
}

.ai-spinner {
    border: 2px solid rgba(255, 207, 2, 0.3);
    border-top: 2px solid #FFCF02;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- CHALLENGE MODE BUTTONS --- */
.challenge-mode-btn {
    padding: 15px;
    background: #18181b;
    border: 2px solid #333;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    width: 100%;
    /* Ensure full width in flex container */
    display: block;
}

#btn-challenge-easy:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6) !important;
    /* Green */
    border-color: #22c55e !important;
    color: #22c55e !important;
}

#btn-challenge-medium:hover {
    box-shadow: 0 0 20px rgba(255, 207, 2, 0.6) !important;
    /* Yellow */
    border-color: #FFCF02 !important;
    color: #FFCF02 !important;
}

#btn-challenge-hard:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
    /* Red */
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* --- CUSTOMIZE MODAL BUTTONS --- */
.cust-btn {
    padding: 15px;
    background: #18181b;
    border: 2px solid #333;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    width: 100%;
    display: block;
}

.cust-btn:hover {
    border-color: #FFCF02;
    color: #FFCF02;
    box-shadow: 0 0 15px rgba(255, 207, 2, 0.3);
}

.cust-btn.selected {
    background: #FFCF02 !important;
    border-color: #FFCF02 !important;
    color: black !important;
    box-shadow: 0 0 20px rgba(255, 207, 2, 0.5) !important;
}

/* Specific Glows for Customize Difficulty (matching Challenge Mode) */
#btn-cust-easy:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6) !important;
    border-color: #22c55e;
    color: #22c55e;
}

#btn-cust-easy.selected {
    background: #22c55e !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8) !important;
}

#btn-cust-medium:hover {
    box-shadow: 0 0 20px rgba(255, 207, 2, 0.6) !important;
    border-color: #FFCF02;
    color: #FFCF02;
}

#btn-cust-medium.selected {
    background: #FFCF02 !important;
    border-color: #FFCF02 !important;
}

#btn-cust-hard:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
    border-color: #ef4444;
    color: #ef4444;
}

#btn-cust-hard.selected {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8) !important;
}

/* --- AI SMART SEARCH TAGS & UI --- */
.ai-tag-input-wrapper {
    background: #000;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 50px;
    transition: border-color 0.3s ease;
}

.ai-tag-input-wrapper:focus-within {
    border-color: #FFCF02;
}

#ai-tag-input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    flex: 1;
    min-width: 150px;
    font-size: 0.95rem;
    padding: 4px 0;
}

.ai-tag {
    background: rgba(255, 207, 2, 0.15);
    border: 1px solid rgba(255, 207, 2, 0.3);
    color: #FFCF02;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: popIn 0.2s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ai-tag-remove {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ai-tag-remove:hover {
    opacity: 1;
    color: #fff;
}

/* Suggestions */
.ai-suggestions-wrapper {
    margin-top: 12px;
    background: #111;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 10px;
}

.suggestion-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.ai-suggestions-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-suggestion-item {
    background: #222;
    color: #aaa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ai-suggestion-item:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

/* Status Bar */
.ai-count-text {
    font-size: 0.8rem;
    color: #6a6a6a;
    font-style: italic;
}

.ai-count-text.found {
    color: #22c55e;
    font-weight: bold;
    font-style: normal;
}

.ai-plus-btn {
    background: #18181b;
    border: 1px solid #333;
    color: #FFCF02;
    border-radius: 8px;
    padding: 0 12px;
    height: 32px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-plus-btn:hover {
    background: #FFCF02;
    color: black;
    border-color: #FFCF02;
    transform: scale(1.05);
}

.ai-spinner {
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid #FFCF02;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* --- AI HISTORY PANEL --- */
#ai-history-panel {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-history-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
    gap: 12px;
}

.ai-history-row:last-child {
    border-bottom: none;
}

.ai-history-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ai-history-date {
    font-size: 0.7rem;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    min-width: 50px;
}

.ai-history-tags {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ai-history-tag-chip {
    font-size: 0.75rem;
    background: rgba(255, 207, 2, 0.1);
    color: #FFCF02;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 207, 2, 0.2);
}

.ai-history-action {
    color: #444;
    font-weight: bold;
}

.ai-history-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-history-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #FFCF02;
}

.ai-history-btn.active {
    background: #FFCF02;
    color: #000;
}

/* Custom scrollbar for history */
#ai-history-panel::-webkit-scrollbar {
    width: 4px;
}
#ai-history-panel::-webkit-scrollbar-track {
    background: transparent;
}
#ai-history-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.ai-history-btn-large {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 207, 2, 0.3);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ai-history-btn-large:hover {
    background: rgba(255, 207, 2, 0.1);
    border-color: #FFCF02;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 207, 2, 0.1);
}

.ai-history-btn-large:active {
    transform: translateY(0);
}

.ai-action-btn {
    background: #FFCF02;
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 207, 2, 0.2);
}

.ai-action-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 207, 2, 0.4);
}

.ai-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #444 !important;
    color: #888 !important;
}