/* Huginn Components Stylesheet - Updated 2026-01-30 */

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--color-background-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-text {
    background: none;
    color: var(--color-accent);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-text:hover {
    background: var(--color-background-alt);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.875rem;
}

/* Concept links in content */
.concept-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.concept-link:hover {
    text-decoration: underline;
}

/* Primary concept (darker blue, bold) */
.concept-link-primary {
    color: #1557b0;
    font-weight: 600;
}

/* Secondary concept (lighter, faded) */
.concept-link-secondary {
    opacity: 0.6;
    font-weight: 500;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    display: inline-block;
}

.bell-icon {
    text-decoration: none;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bell-img {
    width: 24px;
    height: 24px;
    vertical-align: bottom;
}

.notification-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: #e53935;
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: #f9f9f9;
}

.dropdown-header span {
    font-weight: 600;
}

.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-content .loading,
.dropdown-content .empty,
.dropdown-content .error {
    padding: 1.5rem;
    text-align: center;
    color: #666;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.notification-item:hover {
    background: #f5f5f5;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item.unread:hover {
    background: #e3f0ff;
}

.notification-indicator {
    flex-shrink: 0;
    font-size: 0.625rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-content strong {
    font-weight: 600;
}

.notification-content em {
    color: var(--color-accent);
    font-style: normal;
}

.notification-time {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.dropdown-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
    background: #f9f9f9;
}

.dropdown-footer a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.875rem;
}

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

/* Mobile notification adjustments */
@media (max-width: 480px) {
    .notification-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .notification-item {
        padding: 0.625rem 0.75rem;
    }

    .notification-content {
        font-size: 0.8125rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-hint {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 14px;
    color: var(--color-text-light);
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
}

.alert-error {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #27ae60;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

/* Site Header */
.site-header {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: block;
}

.logo-text {
    /* Text inherits styles from parent .logo */
}

.logo-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.feedback-link {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-decoration: none;
    padding: 2px 8px;
    background: var(--color-background-alt);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.feedback-link:hover {
    background: #e8f0fe;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--color-background-alt);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-menu a {
    color: var(--color-text);
    text-decoration: none;
}

/* Mobile Navigation - Two Row Layout */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Row 1: Logo + User Menu */
    .logo-group {
        order: 1;
        gap: var(--spacing-sm);
    }

    .logo {
        font-size: 18px;  /* Slightly smaller on mobile */
    }

    .logo-icon {
        width: 28px;  /* Slight downscale from 32px native */
        height: 28px;
    }

    .feedback-link {
        font-size: 0.7rem;
    }

    .user-menu {
        order: 2;
        margin-left: auto;  /* Push to right */
        gap: var(--spacing-xs);  /* Tighter gap */
    }

    /* Row 2: Nav Links (centered, full width) */
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: var(--spacing-sm);  /* Tighter gap */
        padding-top: var(--spacing-xs);
        margin: 0;
    }

    .nav-links li {
        margin: 0;
    }

    .nav-links a {
        font-size: 14px;  /* Smaller text */
        padding: var(--spacing-xs);
    }

    /* Very small screens - additional adjustments */
    @media (max-width: 480px) {
        .user-menu > a {
            font-size: 14px;
            max-width: 80px;  /* Truncate long usernames */
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .btn-text {
            font-size: 12px;
            padding: var(--spacing-xs);
        }
    }
}

/* Post Card */
.post-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.post-author {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text);
}

.post-author:hover strong {
    text-decoration: underline;
}

.post-author strong {
    font-size: 16px;
    color: var(--color-text);
}

.post-author .username {
    font-size: 14px;
    color: var(--color-text-light);
}

.post-card time {
    font-size: 14px;
    color: var(--color-text-light);
    white-space: nowrap;
}

.post-content {
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: var(--spacing-sm);
}

.post-content a {
    color: var(--color-accent);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border);
}

.btn-danger {
    color: var(--color-error);
}

.btn-danger:hover {
    background: #fadbd8;
}

/* User Card */
.user-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.user-card-header {
    margin-bottom: var(--spacing-sm);
}

.user-card-name {
    text-decoration: none;
    display: block;
}

.user-card-name:hover strong {
    text-decoration: underline;
}

.user-card-name strong {
    font-size: 18px;
    color: var(--color-text);
    display: block;
}

.user-card-name .username {
    font-size: 14px;
    color: var(--color-text-light);
}

.user-card-bio {
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.user-card-stats {
    display: flex;
    gap: var(--spacing-md);
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.user-card-stats strong {
    color: var(--color-text);
}

.user-card-actions {
    margin-top: var(--spacing-md);
}

/* ========================================
   CONTRIBUTION CARDS (Reusable)
   ======================================== */

.contributions-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.contributions-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.contribution-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem;
}

.contribution-card.deleted {
    background: #fafafa;
    border-color: #eee;
}

.contribution-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.author-name {
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.author-name:hover {
    color: #1a73e8;
}

.deleted-author {
    color: #999;
    font-weight: normal;
}

.timestamp {
    color: #888;
    font-size: 0.8125rem;
    margin-left: auto;
}

.contribution-content {
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-line;
}

.deleted-content {
    color: #999;
}

.contribution-footer {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contribution-footer .btn-text {
    background: none;
    border: none;
    color: #666;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}

.contribution-footer .btn-text:hover {
    color: #1a73e8;
}

.contribution-footer .btn-text.btn-danger:hover {
    color: #d32f2f;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.empty-contributions {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Feedback-specific elements within contribution cards */
.feedback-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #666;
}

.feedback-category.category-bug {
    background: #ffebee;
    color: #c62828;
}

.feedback-category.category-feature {
    background: #e3f2fd;
    color: #1565c0;
}

.feedback-category.category-improvement {
    background: #f3e5f5;
    color: #6a1b9a;
}

.feedback-response {
    margin-top: 0.5rem;
    padding: 0.625rem;
    background: #f8f9fa;
    border-left: 3px solid #1a73e8;
    border-radius: 0 4px 4px 0;
}

.feedback-response strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #333;
}

.feedback-response p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.feedback-response small {
    display: block;
    color: #888;
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.feedback-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.feedback-status.status-new {
    background: #fff3cd;
    color: #856404;
}

.feedback-status.status-in_progress {
    background: #cfe2ff;
    color: #084298;
}

.feedback-status.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.feedback-status.status-archived {
    background: #e2e3e5;
    color: #41464b;
}

.feedback-status.status-spawned {
    background: #e0cffc;
    color: #6f42c1;
}

.feedback-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.feedback-badge.badge-spawned {
    background: #e0cffc;
    color: #6f42c1;
}
