/* Crawlere Proiecte - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

a {
    color: #4b5563;
    text-decoration: underline;
    text-decoration-color: #d1d5db;
    text-underline-offset: 2px;
}
a:hover {
    color: #111827;
    text-decoration-color: #111827;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

main {
    flex: 1;
}

/* Cards */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 10px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.7;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed { background-color: #d4edda; color: #155724; }
.status-running { background-color: #cce5ff; color: #004085; }
.status-pending { background-color: #fff3cd; color: #856404; }
.status-failed { background-color: #f8d7da; color: #721c24; }
.status-partial { background-color: #ffeeba; color: #856404; }

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

/* Source type badges */
.source-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-type-static { background-color: #e7f3ff; color: #0066cc; }
.source-type-spa { background-color: #fff3e0; color: #e65100; }
.source-type-api { background-color: #e8f5e9; color: #2e7d32; }
.source-type-rss { background-color: #fce4ec; color: #c2185b; }

/* Project cards */
.project-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-card .project-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    text-decoration: none;
}

.project-card .project-title:hover {
    color: var(--primary-color);
}

.project-card .project-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.project-card .project-source {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background-color: #e9ecef;
    border-radius: 3px;
}

/* Truncate long text */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #4b5563;
    text-decoration: none;
}

.page-item.active .page-link {
    background-color: #4b5563;
    border-color: #4b5563;
}

/* Search form */
.search-form {
    max-width: 400px;
}

/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Log viewer */
.log-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    padding: 1rem;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.log-viewer .log-entry {
    padding: 0.25rem 0;
    border-bottom: 1px solid #333;
    line-height: 1.5;
}

.log-viewer .log-time {
    color: #808080;
    margin-right: 0.5rem;
}

.log-viewer .log-level {
    display: inline-block;
    width: 70px;
    font-weight: bold;
    margin-right: 0.5rem;
}

.log-viewer .log-component {
    color: #c586c0;
    margin-right: 0.5rem;
}

.log-viewer .log-component::before { content: '['; }
.log-viewer .log-component::after { content: ']'; }

.log-viewer .log-message {
    color: #d4d4d4;
}

.log-viewer .log-context {
    color: #9cdcfe;
    display: block;
    margin-left: 2rem;
    font-size: 0.75rem;
    word-break: break-all;
}

.log-viewer .log-debug .log-level { color: #6a9955; }
.log-viewer .log-info .log-level { color: #4fc1ff; }
.log-viewer .log-warning .log-level { color: #dcdcaa; }
.log-viewer .log-error .log-level { color: #f14c4c; }
.log-viewer .log-critical .log-level { color: #ff0000; }

/* Action buttons - iOS-style circular buttons */
.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 0.85rem;
    border-radius: 50%;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none;
}

.btn-action:hover {
    background: #e9ecef;
    color: #495057;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-action.btn-crawl {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-action.btn-crawl:hover {
    background: linear-gradient(180deg, #2dd4a0 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-action.btn-crawl:disabled {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn-action.btn-danger {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-action.btn-danger:hover {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-action.btn-warning {
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn-action.btn-warning:hover {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Job history squares - refined pill style */
.job-history {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.job-square {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.job-square:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.job-square:active {
    transform: scale(0.95);
}

.job-square.job-completed {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
}

.job-square.job-failed {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

.job-square.job-partial {
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
}

.job-square.job-running {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.job-square.job-pending {
    background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
    }
}

/* Project count plain style */
.project-count {
    font-weight: 600;
    color: #374151;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
}

/* Animation for new items */
@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

.highlight-new {
    animation: highlight 2s ease-out;
}
