/**
 * AI Discoverability Agent Styles
 */

/* Widget Container */
.ai-disco-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Position variants */
.ai-disco-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-disco-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.ai-disco-widget.top-right {
    top: 20px;
    right: 20px;
}

.ai-disco-widget.top-left {
    top: 20px;
    left: 20px;
}

/* Floating Toggle Button */
.ai-disco-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    position: relative;
}

.ai-disco-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ai-disco-toggle.open {
    transform: scale(0.9);
}

.ai-disco-toggle svg {
    width: 28px;
    height: 28px;
}

/* Badge */
.ai-disco-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Panel */
.ai-disco-panel {
    position: fixed;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(calc(100% + 100px));
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.ai-disco-widget.bottom-right .ai-disco-panel,
.ai-disco-widget.bottom-left .ai-disco-panel {
    bottom: 90px;
}

.ai-disco-widget.top-right .ai-disco-panel,
.ai-disco-widget.top-left .ai-disco-panel {
    top: 90px;
}

.ai-disco-widget.bottom-right .ai-disco-panel {
    right: 0;
}

.ai-disco-widget.bottom-left .ai-disco-panel {
    left: 0;
}

.ai-disco-widget.top-right .ai-disco-panel {
    right: 0;
}

.ai-disco-widget.top-left .ai-disco-panel {
    left: 0;
}

.ai-disco-panel.open {
    transform: translateY(0);
    opacity: 1;
}

/* Header */
.ai-disco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-disco-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-disco-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-disco-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tabs */
.ai-disco-tabs {
    display: flex;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
}

.ai-disco-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.ai-disco-tab:hover {
    color: #667eea;
}

.ai-disco-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Content Area */
.ai-disco-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-disco-tab-content {
    display: none;
}

.ai-disco-tab-content.active {
    display: block;
}

/* Score Card */
.ai-disco-score-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.score-ring {
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.score-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.score-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-platform {
    font-size: 12px;
    color: #666;
}

.score-value {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

/* Buttons */
.ai-disco-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.ai-disco-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-disco-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-disco-btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.ai-disco-btn.secondary:hover {
    background: #e0e0e0;
}

.ai-disco-btn.small {
    padding: 8px 16px;
    font-size: 12px;
    width: auto;
}

.ai-disco-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ai-disco-btn.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.ai-disco-btn.loading .btn-loader {
    display: block;
    position: absolute;
}

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

/* Recommendations List */
.recommendations-header,
.applied-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recommendations-header h4,
.applied-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.recommendations-list,
.applied-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
}

.recommendation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-card.priority-critical {
    border-left: 4px solid #ff4444;
}

.recommendation-card.priority-high {
    border-left: 4px solid #ff9800;
}

.recommendation-card.priority-medium {
    border-left: 4px solid #ffc107;
}

.recommendation-card.priority-low {
    border-left: 4px solid #4caf50;
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rec-priority {
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
}

.recommendation-card.priority-critical .rec-priority {
    background: #ffebee;
    color: #c62828;
}

.recommendation-card.priority-high .rec-priority {
    background: #fff3e0;
    color: #e65100;
}

.recommendation-card.priority-medium .rec-priority {
    background: #fff8e1;
    color: #f57f17;
}

.rec-impact {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.recommendation-card h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.rec-description {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.rec-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.platform-tag {
    font-size: 11px;
    padding: 4px 8px;
    background: #e8eaf6;
    color: #5c6bc0;
    border-radius: 4px;
}

.manual-steps {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
}

.manual-steps strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.manual-steps ul {
    margin: 0;
    padding-left: 20px;
}

.manual-steps li {
    margin-bottom: 4px;
    color: #666;
}

/* Applied Changes */
.applied-card {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.applied-header {
    margin-bottom: 8px;
}

.applied-card h5 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.applied-time {
    font-size: 11px;
    color: #999;
    margin: 4px 0;
}

.applied-category {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    margin: 4px 0 0 0;
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
}

/* Empty States */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 13px;
}

/* Notifications */
.ai-disco-notification {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000000;
}

.ai-disco-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.ai-disco-notification.success {
    border-left: 4px solid #4caf50;
}

.ai-disco-notification.error {
    border-left: 4px solid #f44336;
}

.ai-disco-notification.info {
    border-left: 4px solid #2196f3;
}

/* Dark Theme */
.ai-disco-widget.dark .ai-disco-panel {
    background: #1e1e1e;
    color: #e0e0e0;
}

.ai-disco-widget.dark .ai-disco-tabs {
    background: #2a2a2a;
    border-bottom-color: #3a3a3a;
}

.ai-disco-widget.dark .ai-disco-tab {
    color: #999;
}

.ai-disco-widget.dark .ai-disco-tab.active {
    background: #1e1e1e;
    color: #667eea;
}

.ai-disco-widget.dark .recommendation-card,
.ai-disco-widget.dark .applied-card {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

.ai-disco-widget.dark .score-item {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 480px) {
    .ai-disco-panel {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
    }

    .ai-disco-widget.bottom-right,
    .ai-disco-widget.bottom-left {
        right: 20px;
        left: 20px;
    }

    .ai-disco-toggle {
        width: 56px;
        height: 56px;
    }

    .ai-disco-content {
        padding: 16px;
    }

    .score-breakdown {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.ai-disco-content::-webkit-scrollbar {
    width: 6px;
}

.ai-disco-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ai-disco-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ai-disco-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Analysis Results */
.analysis-results {
    margin-top: 16px;
}

.analysis-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.analysis-section h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
}

.analysis-section ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #666;
}

.analysis-section li {
    margin-bottom: 4px;
}
