/* Article Management System Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Flash Alerts - Smooth transitions */
.alert {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 1;
}

.alert.fade {
    opacity: 0;
    transform: translateY(-10px);
}

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Article Cards */
.article-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-card .card-title a {
    color: #2c3e50;
    transition: color 0.2s;
}

.article-card .card-title a:hover {
    color: var(--primary-color);
}

.article-card .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Object fit cover for images */
.object-fit-cover {
    object-fit: cover;
    width: 100%;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

/* Article Detail Page */
.article-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    font-size: 1.125rem;
    color: #2c3e50;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: #1a252f;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.375rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: border-bottom 0.2s;
}

.article-content a:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
}

.article-content strong {
    font-weight: 600;
    color: #1a252f;
}

.article-content em {
    font-style: italic;
    color: #4a5568;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.article-content code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background-color: transparent;
    padding: 0;
}

/* Reaction Buttons */
.reaction-buttons .btn {
    transition: all 0.2s;
    border-width: 2px;
}

.reaction-buttons .btn.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.reaction-buttons .btn-outline-danger.active {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Comments */
.comment {
    border-left: 3px solid #e9ecef;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.comment:hover {
    border-left-color: var(--primary-color);
}

.comment-author {
    font-weight: 600;
    color: #495057;
}

.comment-date {
    font-size: 0.875rem;
    color: #6c757d;
}

.comment-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.comment-reply {
    margin-left: 2rem;
    margin-top: 1rem;
    border-left: 3px solid #dee2e6;
    padding-left: 1rem;
    background-color: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .comment-reply {
        margin-left: 1rem;
    }

    .reaction-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .reaction-buttons .btn {
        flex: 1;
        min-width: auto;
    }
}

/* Comment Form - Improved checkbox alignment */
.comment-section .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.comment-section .form-check-input {
    margin-top: 0.25rem; /* Align with first line of text */
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.comment-section .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    padding-top: 0.1rem; /* Slight adjustment to align with checkbox */
}

/* Comment form button alignment */
.comment-section .form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.comment-section .btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Admin Dashboard - Responsive Table */
@media (max-width: 768px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    .table-responsive table {
        min-width: 700px; /* Ensure table doesn't shrink too much */
    }
    
    /* Stack table headers on very small screens if needed */
    .table-responsive {
        border: 0;
    }
}

/* Pagination - Responsive */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap !important;
        gap: 0.25rem;
    }
    
    .pagination .page-item {
        margin: 0;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .pagination .page-item.disabled .page-link {
        padding: 0.375rem 0.75rem;
    }
}

/* Admin Dashboard Cards */
.admin-dashboard-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Action buttons in tables */
.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Badge status indicators */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Admin Dashboard */
.card .bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.card .bg-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
}

.card .bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

.card .bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* SEO Score colors */
.seo-score-excellent {
    color: var(--success-color);
}

.seo-score-good {
    color: var(--info-color);
}

.seo-score-fair {
    color: var(--warning-color);
}

.seo-score-poor {
    color: var(--danger-color);
}

/* Utility classes */
.text-justify {
    text-align: justify;
}

.rounded-start {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.rounded-end {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Breadcrumb */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .reaction-buttons,
    .comment-section {
        display: none !important;
    }

    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
        width: 100%;
    }
}