/* Luneras PageRanker Pro - Frontend Styles */
/* Matches pageranker.net blue/green gradient design */

.lpr-frontend-tool {
    --primary: #2563eb;
    --accent: #22c55e;
    --bg: #f9fafb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.lpr-tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.lpr-tool-header h2 {
    margin: 0 0 12px 0;
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lpr-tool-header p {
    margin: 0;
    font-size: 18px;
    color: #6b7280;
}

.lpr-tool-form {
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.lpr-tool-input {
    flex: 1;
    min-width: 300px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 18px;
    transition: all 0.3s;
}

.lpr-tool-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.lpr-tool-btn {
    padding: 16px 36px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: white;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lpr-tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.lpr-tool-loading {
    text-align: center;
    padding: 60px;
    background: var(--bg);
    border-radius: 16px;
}

.lpr-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lpr-result-summary {
    background: linear-gradient(135deg, #eef2ff, #dcfce7);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

.lpr-summary-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: var(--primary);
    font-weight: 800;
}

.lpr-timestamp {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.lpr-summary-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.lpr-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lpr-stat-number {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.lpr-stat-label {
    font-size: 16px;
    color: #6b7280;
    margin-top: 8px;
    font-weight: 600;
}

.lpr-metric-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.lpr-category-card {
    background: white;
    padding: 0;
    border-radius: 16px;
    border: 2px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lpr-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.lpr-category-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lpr-category-title {
    margin: 0;
    font-size: 20px;
    color: var(--primary);
    font-weight: 800;
}

.lpr-category-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.lpr-category-description {
    margin: 0;
    padding: 16px 24px;
    font-size: 14px;
    color: #6b7280;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
}

.lpr-metrics-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 24px;
}

.lpr-metrics-list::-webkit-scrollbar {
    width: 8px;
}

.lpr-metrics-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.lpr-metrics-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.lpr-metrics-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.lpr-metric-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 10px;
    background: var(--bg);
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.lpr-metric-row:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.lpr-metric-icon {
    font-size: 16px;
    line-height: 1;
}

.lpr-metric-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.lpr-metric-result {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-width: 0;
}

.lpr-metric-group {
    margin: 16px 0;
    padding: 12px;
    border-left: 4px solid var(--primary);
    background: #f8fafc;
    border-radius: 8px;
}

.lpr-group-header {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpr-group-header:before {
    content: '📁';
    font-size: 16px;
}

.lpr-group-content {
    padding-left: 8px;
}

.lpr-status-good {
    border-left-color: #22c55e;
}

.lpr-status-good .lpr-metric-result {
    color: #16a34a;
    background: #f0fdf4;
    border-color: #bbf7d0;
    font-weight: 700;
}

.lpr-status-warning {
    border-left-color: #ef4444;
}

.lpr-status-warning .lpr-metric-result {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
    font-weight: 700;
}

.lpr-status-neutral {
    border-left-color: #3b82f6;
}

.lpr-status-neutral .lpr-metric-result {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.lpr-category-count {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #6b7280;
}

.lpr-view-details {
    padding: 10px 24px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lpr-view-details:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .lpr-tool-form {
        flex-direction: column;
    }
    
    .lpr-tool-input {
        min-width: 100%;
    }
    
    .lpr-metric-categories {
        grid-template-columns: 1fr;
    }
    
    .lpr-metric-row {
        grid-template-columns: 24px 1fr;
        gap: 8px;
    }
    
    .lpr-metric-result {
        grid-column: 1 / -1;
        margin-left: 32px;
        text-align: left;
        margin-top: 4px;
    }
    
    .lpr-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .lpr-summary-stats {
        gap: 30px;
    }
    
    .lpr-metric-group {
        margin-left: 0 !important;
    }
    
    .lpr-metric-row {
        margin-left: 0 !important;
    }
}
