/**
 * Reddit Questions Diagnostic Plugin Styles
 */

/* Container */
.reddit-questions-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

/* Form */
.reddit-questions-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

/* Options */
.reddit-questions-options {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-right: 15px;
    color: #333;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #ff4500;
    box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.2);
}

/* Search scope buttons */
.search-scope-buttons {
    display: flex;
    gap: 10px;
}

.scope-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scope-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scope-button span {
    font-size: 14px;
    font-weight: 500;
}

.scope-button:hover {
    background-color: #f8f9fa;
}

.scope-button.active {
    background-color: #ff4500;
    border-color: #ff4500;
    color: white;
}

/* Input */
.reddit-questions-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    outline: none;
}

.reddit-questions-input:focus {
    border-color: #ff4500;
    box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.2);
}

/* Button */
.reddit-questions-button {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-color: #ff4500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reddit-questions-button:hover {
    background-color: #e03d00;
}

/* Loading */
.reddit-questions-loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.reddit-questions-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 69, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ff4500;
    animation: spin 1s ease-in-out infinite;
}

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

/* Error */
.reddit-questions-error {
    display: none;
    padding: 15px;
    margin: 20px 0;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Results */
.reddit-questions-results {
    display: none;
    margin-top: 30px;
}

.reddit-questions-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.reddit-questions-results-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.reddit-questions-results-count {
    font-size: 14px;
    color: #6c757d;
}

.reddit-questions-export-button {
    padding: 8px 15px;
    font-size: 14px;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reddit-questions-export-button:hover {
    background-color: #218838;
}

/* List */
.reddit-questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reddit-questions-item {
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reddit-questions-item-title {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.4;
}

.reddit-questions-item-rank {
    font-weight: 600;
    color: #ff4500;
    margin-right: 5px;
}

.reddit-questions-item-title a {
    color: #1a1a1b;
    text-decoration: none;
}

.reddit-questions-item-title a:hover {
    color: #ff4500;
    text-decoration: underline;
}

.reddit-questions-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #6c757d;
}

.reddit-questions-item-meta span:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.reddit-questions-item-preview {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    border-left: 3px solid #ff4500;
}

/* Sentiment styles */
.sentiment-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.reddit-questions-item-sentiment {
    font-weight: 500;
}

.sentiment-positive {
    color: #28a745;
}

.sentiment-negative {
    color: #dc3545;
}

.sentiment-neutral {
    color: #6c757d;
}

/* Item border colors based on sentiment */
.reddit-questions-item.sentiment-positive {
    border-left: 4px solid #28a745;
}

.reddit-questions-item.sentiment-negative {
    border-left: 4px solid #dc3545;
}

.reddit-questions-item.sentiment-neutral {
    border-left: 4px solid #6c757d;
}

.reddit-questions-item-subreddit:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ff4500'%3E%3Cpath d='M10 0C4.5 0 0 4.5 0 10s4.5 10 10 10 10-4.5 10-10S15.5 0 10 0zm5.5 11.5c0 1.4-1.1 2.5-2.5 2.5H7c-1.4 0-2.5-1.1-2.5-2.5V8.5C4.5 7.1 5.6 6 7 6h6c1.4 0 2.5 1.1 2.5 2.5v3z'/%3E%3C/svg%3E");
}

.reddit-questions-item-score:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236c757d'%3E%3Cpath d='M10 2.5L5 7.5h3v5H5l5 5 5-5h-3v-5h3z'/%3E%3C/svg%3E");
}

.reddit-questions-item-comments:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236c757d'%3E%3Cpath d='M10 0C4.5 0 0 4.5 0 10c0 2.1.6 4 1.7 5.6L.4 19.4c-.2.2-.2.5-.1.8.1.2.4.4.7.4h9c5.5 0 10-4.5 10-10S15.5 0 10 0zm5 11H5c-.6 0-1-.4-1-1s.4-1 1-1h10c.6 0 1 .4 1 1s-.4 1-1 1zm0-4H5c-.6 0-1-.4-1-1s.4-1 1-1h10c.6 0 1 .4 1 1s-.4 1-1 1z'/%3E%3C/svg%3E");
}

.reddit-questions-item-date:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236c757d'%3E%3Cpath d='M15 2h-2v1c0 .6-.4 1-1 1s-1-.4-1-1V2H9v1c0 .6-.4 1-1 1s-1-.4-1-1V2H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 13c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1V7h10v8zM7 9h2v2H7V9zm4 0h2v2h-2V9zm-4 4h2v2H7v-2zm4 0h2v2h-2v-2z'/%3E%3C/svg%3E");
}

/* Diagnostic Styles */
.diagnostic-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.diagnostic-section h3 {
    margin-top: 0;
    color: #ff4500;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.diagnostic-results {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    display: none;
}

.diagnostic-results.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.diagnostic-results.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.diagnostic-results pre {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    overflow: auto;
    max-height: 300px;
}

.diagnostic-form {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-row label {
    width: 120px;
    font-weight: 500;
}

.form-row input {
    flex: 1;
}

.troubleshooting-tips {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 15px;
    color: #856404;
}

.troubleshooting-tips ul {
    margin-top: 5px;
    padding-left: 20px;
}

.troubleshooting-tips li {
    margin-bottom: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .reddit-questions-form {
        flex-direction: column;
    }

    .reddit-questions-input,
    .reddit-questions-button {
        width: 100%;
    }

    .reddit-questions-item-meta {
        flex-direction: column;
        gap: 5px;
    }

    .option-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .option-label {
        margin-bottom: 5px;
    }

    .search-scope-buttons {
        width: 100%;
    }

    .scope-button {
        flex: 1;
        justify-content: center;
    }

    .filter-select {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row label {
        width: 100%;
        margin-bottom: 5px;
    }
}
