/**
 * AI Failed Stories - Main CSS File
 * No build process required - vanilla CSS
 */

/* Reset and base styles */
* {
    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-color: #f8f9fa;
}

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

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 48px;
    width: auto;
}

.title-section h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.title-section .subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.nav a {
    text-decoration: none;
    color: #007bff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.nav a:hover {
    background-color: #e9ecef;
}

.nav a.active {
    background-color: #007bff;
    color: white;
}

/* Search and filters */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background: #0056b3;
}

/* Sort tabs */
.sort-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.sort-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #6c757d;
    transition: all 0.2s;
}

.sort-tab:hover {
    color: #007bff;
}

.sort-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

/* Story items */
.stories-container {
    display: grid;
    gap: 1.5rem;
}

.story-item {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}


.impact-tag {
    background: #eef2ff;
    color: #3730a3;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.incident-date {
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
}
.story-header h3 {
    margin-bottom: 0.5rem;
}

.story-header h3 a {
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.story-header h3 a:hover {
    color: #007bff;
}

.story-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.ai-tool {
    background: #e3f2fd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: #1976d2;
    font-weight: 500;
}

.story-content p {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.story-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.like-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    color: #6c757d;
}

.like-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.like-btn.liked {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.comments, .views {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Forms */
.form-section {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.25rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Comments */
.comments-section {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.comment {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
}

.comment-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.reply-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.reply-btn:hover {
    text-decoration: underline;
}

.reply {
    margin-left: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

.reply-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
}

.reply-form-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    resize: vertical;
    min-height: 80px;
}

.reply-form-container button {
    margin-right: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #007bff;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

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

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Notifications */
.notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert {
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

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

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading indicator */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .sort-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .story-stats {
        flex-wrap: wrap;
    }

    .nav {
        flex-direction: column;
        align-items: center;
    }

    .comment-actions {
        flex-wrap: wrap;
    }

    .reply {
        margin-left: 1rem;
    }
}

/* Tags and Media */
.story-tags {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.story-media {
    margin-top: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Media links in story detail */
.media-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.media-links h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #495057;
}

.media-link {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    color: #007bff;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.media-link:hover {
    background: #e9ecef;
    border-color: #007bff;
    text-decoration: none;
}

@media (max-width: 480px) {
    .form-section, .comments-section {
        padding: 1rem;
    }

    .story-item {
        padding: 1rem;
    }

    .story-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .story-tags {
        gap: 0.25rem;
    }

    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
