/**
 * Domain Spider Styles
 * Cool AI-like interface
 */

/* ============================================
   CONTAINER
   ============================================ */

.spider-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

.spider-header {
    text-align: center;
    margin-bottom: 30px;
}

.spider-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1e293b;
}

.spider-header p {
    color: #64748b;
    font-size: 16px;
}

/* ============================================
   FORM
   ============================================ */

.spider-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.spider-form input[type="url"] {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.spider-form input[type="url"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.spider-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.spider-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.spider-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spider-btn.crawling .btn-text {
    display: none;
}

.spider-btn.crawling::after {
    content: "🕷️ Crawling...";
}

/* ============================================
   INFO BOX
   ============================================ */

.spider-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 30px;
}

.spider-info p {
    margin: 0;
    color: #0369a1;
    font-size: 14px;
}

/* ============================================
   CRAWL WARNING BANNER
   ============================================ */

.spider-crawl-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    animation: warningPulse 3s ease-in-out infinite;
}

.crawl-warning-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.crawl-warning-icon {
    font-size: 28px;
    color: #b45309;
    flex-shrink: 0;
    line-height: 1;
}

.crawl-warning-text {
    flex: 1;
}

.crawl-warning-text strong {
    display: block;
    color: #92400e;
    font-size: 15px;
    margin-bottom: 2px;
}

.crawl-warning-detail {
    display: block;
    font-size: 13px;
    color: #a16207;
}

.crawl-warning-timer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #92400e;
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
}

@keyframes warningPulse {
    0%, 100% { border-color: #f59e0b; }
    50% { border-color: #d97706; box-shadow: 0 0 12px rgba(245, 158, 11, 0.25); }
}

/* ============================================
   CHAT INTERFACE (AI Loading)
   ============================================ */

.spider-progress {
    margin-top: 30px;
}

.spider-chat {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    padding: 24px;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
}

.chat-message {
    margin-bottom: 12px;
    opacity: 0;
    animation: chatFadeIn 0.4s ease forwards;
}

.chat-message.system {
    color: #94a3b8;
}

.chat-message.info {
    color: #38bdf8;
}

.chat-message.success {
    color: #4ade80;
}

.chat-message.warning {
    color: #fbbf24;
}

.chat-message.error {
    color: #f87171;
}

.chat-message.highlight {
    color: #a78bfa;
    font-weight: 600;
}

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}

/* Live progress bar */
.live-progress {
    opacity: 1 !important;
    margin-top: 8px;
}

.progress-bar-wrap {
    display: block;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-stats {
    display: block;
    color: #94a3b8;
    font-size: 12px;
}

/* Individual indexed page messages */
.chat-message.indexed-page {
    color: #475569;
    font-size: 12px;
    margin-bottom: 4px;
    padding-left: 12px;
    border-left: 2px solid #334155;
    opacity: 1 !important;
    animation: none;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar */
.spider-chat::-webkit-scrollbar {
    width: 8px;
}

.spider-chat::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.spider-chat::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

/* ============================================
   RESULTS
   ============================================ */

.spider-results {
    margin-top: 30px;
}

.results-summary {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.results-summary h3 {
    color: #047857;
    font-size: 24px;
    margin: 0 0 16px 0;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #047857;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #059669;
}

.results-summary p {
    color: #065f46;
    margin: 16px 0 0 0;
}

/* Indexed URLs list */
.indexed-urls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.indexed-urls h4 {
    margin: 0 0 16px 0;
    color: #334155;
}

.indexed-url-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.indexed-url-item:last-child {
    margin-bottom: 0;
}

.url-icon {
    font-size: 18px;
}

.url-details {
    flex: 1;
    min-width: 0;
}

.url-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-path {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   UPGRADE / LOGIN STATES
   ============================================ */

.spider-login-required,
.spider-upgrade-required {
    max-width: 500px;
    margin: 60px auto;
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.spider-login-required h3,
.spider-upgrade-required h3 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 16px;
}

.spider-login-required p,
.spider-upgrade-required p {
    color: #64748b;
    margin-bottom: 12px;
}

.spider-upgrade-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.spider-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    color: white;
}

/* Tier comparison */
.spider-tier-compare {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 24px 0;
}

.tier-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    min-width: 160px;
    text-align: left;
}

.tier-option.featured {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.tier-option h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #1e293b;
}

.tier-option.featured h4 {
    color: #b45309;
}

.tier-option ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tier-option li {
    padding: 4px 0;
    font-size: 14px;
    color: #64748b;
}

.tier-option li::before {
    content: "✓ ";
    color: #10b981;
}

.tier-option.featured li::before {
    color: #f59e0b;
}

/* ============================================
   DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    .spider-crawl-warning {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        border-color: #d97706;
    }
    
    .crawl-warning-icon {
        color: #fbbf24;
    }
    
    .crawl-warning-text strong {
        color: #fde68a;
    }
    
    .crawl-warning-detail {
        color: #fcd34d;
    }
    
    .crawl-warning-timer {
        color: #fde68a;
    }
    
    .spider-header h2 {
        color: #f1f5f9;
    }
    
    .spider-header p {
        color: #94a3b8;
    }
    
    .spider-form input[type="url"] {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .spider-info {
        background: #1e3a5f;
        border-color: #1e40af;
    }
    
    .spider-info p {
        color: #93c5fd;
    }
    
    .results-summary {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        border-color: #047857;
    }
    
    .results-summary h3,
    .stat-number {
        color: #6ee7b7;
    }
    
    .stat-label,
    .results-summary p {
        color: #a7f3d0;
    }
    
    .indexed-urls {
        background: #1e293b;
        border-color: #334155;
    }
    
    .indexed-urls h4 {
        color: #e2e8f0;
    }
    
    .indexed-url-item {
        background: #0f172a;
        border-color: #334155;
    }
    
    .url-title {
        color: #f1f5f9;
    }
    
    .url-path {
        color: #94a3b8;
    }
    
    .spider-login-required,
    .spider-upgrade-required {
        background: #1e293b;
        border-color: #334155;
    }
    
    .spider-login-required h3,
    .spider-upgrade-required h3 {
        color: #f1f5f9;
    }
    
    .spider-login-required p,
    .spider-upgrade-required p {
        color: #94a3b8;
    }
}
