/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --primary-dark: #2E5C8A;
    --success-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --critical-color: #C0392B;
    --info-color: #3498DB;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --border-color: #E1E8ED;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.form-group {
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.input-wrapper {
    display: flex;
    gap: 12px;
}

input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

button[type="submit"] {
    padding: 14px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button[type="submit"]:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.help-text {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Status Section */
.status-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-icon {
    font-size: 3rem;
}

.status-content {
    flex: 1;
}

.status-content h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.status-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Results Section */
.results-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
}

#resultDomain {
    color: var(--primary-color);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    padding: 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
}

.summary-card.allowed {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.summary-card.blocked {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
}

.summary-card.total {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}

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

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Bot List */
.bot-list {
    display: grid;
    gap: 12px;
}

.bot-item {
    padding: 16px 20px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.bot-item:hover {
    background: var(--border-color);
    transform: translateX(4px);
}

.bot-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.bot-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bot-status.allowed {
    background: var(--success-color);
    color: white;
}

.bot-status.blocked {
    background: var(--danger-color);
    color: white;
}

/* Buttons */
.secondary-btn {
    padding: 10px 20px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Export Section */
.export-section {
    margin-top: 30px;
    text-align: center;
}

/* Error Section */
.error-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.error-card {
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.error-card h3 {
    color: var(--danger-color);
    margin-bottom: 12px;
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Results Styles */
.discrepancy-warning {
    background: linear-gradient(135deg, #FFF3CD, #FFE69C);
    border-left: 4px solid var(--warning-color);
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.discrepancy-warning strong {
    display: block;
    color: #856404;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.discrepancy-warning p {
    color: #856404;
    margin: 0;
    font-size: 0.95rem;
}

.bot-item.discrepancy {
    background: linear-gradient(to right, #FFF9E6, var(--card-bg));
    border-left: 3px solid var(--warning-color);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.discrepancy-badge {
    background: var(--warning-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
}

.blocking-method {
    background: #E8F4F8;
    color: #2E5C8A;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.http-status {
    background: #F0F0F0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

.bot-status-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.robots-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2px 6px;
    background: #F5F5F5;
    border-radius: 4px;
    cursor: help;
}

/* Enhanced Bot Cards */
.bot-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.bot-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.bot-card.has-discrepancy {
    border-left: 4px solid var(--warning-color);
}

.bot-card[data-concern="critical"] {
    border-left: 4px solid var(--critical-color);
    background: #FFF5F5;
}

.bot-card[data-concern="high"] {
    border-left: 4px solid var(--danger-color);
}

.bot-card[data-concern="medium"] {
    border-left: 4px solid var(--warning-color);
}

.bot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.bot-card-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.bot-name-large {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bot-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 8px;
    background: var(--info-color);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    width: fit-content;
}

.bot-status-badge {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.bot-status-badge.allowed {
    background: #E8F5E9;
    color: var(--success-color);
}

.bot-status-badge.blocked {
    background: #FFEBEE;
    color: var(--danger-color);
}

.bot-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #F5F5F5;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.discrepancy-highlight {
    background: #FFF9E6;
    padding: 8px;
    border-radius: 4px;
    border-bottom: none;
    margin-top: 4px;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.concern-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.concern-badge.concern-low {
    background: #E8F5E9;
    color: #2E7D32;
}

.concern-badge.concern-medium {
    background: #FFF9E6;
    color: #F57C00;
}

.concern-badge.concern-high {
    background: #FFEBEE;
    color: #C62828;
}

.concern-badge.concern-critical {
    background: #C0392B;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.bot-recommendation {
    background: #F8F9FA;
    border-left: 3px solid var(--info-color);
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
}

.bot-recommendation strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.bot-recommendation p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bot-card-header {
        flex-direction: column;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

