/* Reddit User Detective - Basic Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ff4500, #ff6b35);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 600px;
    width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.branding {
    background: #ff4500;
    color: white;
    padding: 2rem;
    text-align: center;
}

.branding h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.branding p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    padding: 2rem;
}

.input-section {
    text-align: center;
}

.input-section label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

#username-input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

#username-input:focus {
    outline: none;
    border-color: #ff4500;
}

#analyze-btn {
    background: #ff4500;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#analyze-btn:hover {
    background: #e03e00;
}

#analyze-btn:active {
    background: #cc3700;
}

#analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.loading-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff4500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.loading-content {
    flex: 1;
    text-align: left;
}

.loading-content h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4500, #ff6b35);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: #ff4500;
    font-size: 0.9rem;
    min-width: 35px;
}

.loading-message {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

.cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cancel-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

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

/* Loading Steps */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.step-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-title {
    font-weight: 500;
    color: #333;
}

.step-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Step Status Colors */
.step-status.pending {
    background: #e9ecef;
    color: #6c757d;
}

.step-status.loading {
    background: #fff3cd;
    color: #856404;
    animation: pulse 2s infinite;
}

.step-status.completed {
    background: #d4edda;
    color: #155724;
}

.step-status.error {
    background: #f8d7da;
    color: #721c24;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Step animations */
.loading-step.completed .step-icon {
    animation: checkmark 0.6s ease;
}

@keyframes checkmark {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.loading-step.loading {
    border-color: #ff4500;
    background: #fff5f0;
}

.loading-step.error {
    border-color: #dc3545;
    background: #f8d7da;
}

/* Results Container */
.results-container {
    margin-top: 2rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.tab-button.active {
    color: #ff4500;
    border-bottom-color: #ff4500;
    background: #fff5f0;
}

/* Tab Content */
.tab-content {
    min-height: 200px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Profile Styles */
.user-profile {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ff4500;
    padding-bottom: 1rem;
}

.user-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.suspended-badge {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.verified-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Stats Section */
.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff4500;
}

/* Details Section */
.user-details {
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

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

.detail-label {
    font-weight: 600;
    color: #333;
}

.detail-value {
    color: #666;
}

/* User Subreddit Section */
.user-subreddit {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-subreddit h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #ff4500;
    padding-bottom: 0.5rem;
}

.subreddit-info {
    display: grid;
    gap: 0.75rem;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

.error-message p {
    margin: 0;
    font-weight: 600;
}

/* Sorting Controls */
.sorting-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.sort-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sort-btn.active {
    background: #ff4500;
    color: white;
    border-color: #ff4500;
}

.sort-btn.active:hover {
    background: #e03e00;
    border-color: #e03e00;
}

/* Recent Posts Section */
.user-posts {
    margin-top: 2rem;
}

.user-posts h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #ff4500;
    padding-bottom: 0.5rem;
}

.posts-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.post-number {
    font-weight: bold;
    color: #ff4500;
    min-width: 1.5rem;
}

.post-subreddit {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.post-date {
    margin-left: auto;
    font-style: italic;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-content {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #ff4500;
    white-space: pre-wrap;
}

/* Recent Comments Section */
.user-comments {
    margin-top: 2rem;
}

.user-comments h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #ff4500;
    padding-bottom: 0.5rem;
}

.comments-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.comment-number {
    font-weight: bold;
    color: #ff4500;
    min-width: 1.5rem;
}

.comment-subreddit {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.comment-score {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.comment-date {
    margin-left: auto;
    font-style: italic;
}

.comment-content {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    white-space: pre-wrap;
}

/* Controversial Content Section */
.user-controversial {
    margin-top: 2rem;
}

.user-controversial h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.5rem;
}

.controversial-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controversial-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    border-left: 4px solid #dc3545;
}

.controversial-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.controversial-number {
    font-weight: bold;
    color: #dc3545;
    min-width: 1.5rem;
}

.controversial-type {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
}

.controversial-subreddit {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.controversial-score {
    background: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.controversial-date {
    margin-left: auto;
    font-style: italic;
    font-size: 0.85rem;
}

.controversial-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.controversial-content {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
    white-space: pre-wrap;
}

.controversial-stats {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #666;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 600px) {
    .tab-navigation {
        gap: 0;
    }

    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 80px;
        text-align: center;
    }
    .user-stats {
        grid-template-columns: 1fr;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sorting-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sort-btn {
        width: 100%;
        text-align: center;
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .post-date {
        margin-left: 0;
        font-size: 0.85rem;
    }

    .post-content {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .comment-date {
        margin-left: 0;
        font-size: 0.85rem;
    }

    .comment-content {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .controversial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .controversial-date {
        margin-left: 0;
        font-size: 0.85rem;
    }

    .controversial-content {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .controversial-stats {
        font-size: 0.8rem;
    }
}
