/* Modern Article Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6b7280;
    --light: #f9fafb;
    --dark: #111827;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-article: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
}

/* Modern Page Layout */
.modern-articles-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--light) 0%, #f1f5f9 100%);
    padding: 2rem 0;
}

.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.page-title {
    font-family: var(--font-article);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern button */
.btn-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: var(--font-sans);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #3730a3 100%);
    color: white;
    text-decoration: none;
}

.btn-modern svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Articles grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Enhanced Article Card */
.article-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
}

.article-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--shadow-xl);
}

/* Article image with modern styling */
.article-img { 
    position: relative; 
    aspect-ratio: 16/9;
    overflow: hidden; 
}

.article-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.article-card:hover .article-img img {
    transform: scale(1.05);
}

.article-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .article-img::after {
    opacity: 1;
}

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: capitalize;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-sans);
}

/* Action buttons with modern hover effects */
.action-buttons {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .action-buttons {
    opacity: 1;
}

.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--secondary);
}

.action-btn:hover {
    transform: scale(1.1);
    color: inherit;
    text-decoration: none;
}

.action-btn.edit:hover {
    background: #dbeafe;
    color: var(--primary);
}

.action-btn.delete:hover {
    background: #fee2e2;
    color: var(--danger);
}

.action-btn svg {
    width: 1rem;
    height: 1rem;
}

.article-body { 
    padding: 1.5rem; 
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px); /* Adjust based on image height */
}

.article-date { 
    color: var(--secondary); 
    font-size: 0.875rem; 
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
}

.article-title { 
    font-size: 1.25rem; 
    margin-bottom: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    font-family: var(--font-article);
}

.article-title a { 
    color: var(--dark); 
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover,
.article-card:hover .article-title a { 
    color: var(--primary);
    text-decoration: none;
}

.article-excerpt { 
    color: var(--secondary); 
    margin-bottom: 1rem; 
    flex-grow: 1;
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-sans);
}

.read-more { 
    color: var(--primary); 
    font-weight: 600; 
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    margin-top: auto;
}

.read-more:hover { 
    color: var(--primary-hover);
    text-decoration: none;
}

.read-more svg {
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.read-more:hover svg {
    transform: translateX(2px);
}

.article-actions { 
    margin-top: 1rem; 
    display: flex; 
    gap: 0.5rem; 
}

.article-actions .btn { 
    padding: 0.25rem 0.5rem; 
    font-size: 0.875rem;
    border-radius: var(--radius);
    font-family: var(--font-sans);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.empty-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--secondary);
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 0.5rem 0;
    font-family: var(--font-article);
}

.empty-description {
    color: var(--secondary);
    line-height: 1.6;
    margin: 0 0 2rem 0;
    font-family: var(--font-sans);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Additional Article Show Page Styles */
.article-title {
    font-family: var(--font-article);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #1a202c;
    margin: 0 0 1.5rem 0;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    font-size: 3.25rem; /* 52px */
}

.article-meta {
    font-family: var(--font-sans);
    font-size: 1.1rem; /* 17.6px */
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    flex-wrap: wrap;
}

.article-meta .badge {
    font-size: 0.85em;
    padding: 0.35em 1em;
    border-radius: 20px;
    background-color: var(--primary);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.article-actions .btn {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.article-actions .btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.article-actions .btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.article-actions .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.article-actions .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

.article-meta .d-flex.align-items-center {
    gap: 0.5rem;
}

.article-meta i {
    font-size: 0.95em;
    opacity: 0.8;
}

.article-excerpt {
    font-family: var(--font-sans);
    font-size: 1.7rem; /* 27.2px */
    line-height: 1.7;
    color: #4a5568;
    font-weight: 400;
    margin-bottom: 2.5rem;
    font-style: italic;
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    color: #4b5563;
}

.article-content {
    font-family: var(--font-sans);
    font-size: 1.3rem; /* 20.8px */
    line-height: 1.9;
    color: #1f2937;
    padding: 0 2.5rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.article-content p {
    margin-bottom: 2rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.article-content h2 {
    font-size: 2.25rem; /* 36px */
    margin: 3rem 0 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.75rem; /* 28px */
    margin: 2.5rem 0 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: var(--primary-hover);
    border-bottom-color: currentColor;
}

.article-detail {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.article-header {
    padding: 2rem 2.5rem 0.5rem;
}

.article-content p {
    margin-bottom: 1.75rem;
}

.sidebar-title {
    font-family: var(--font-sans);
    font-weight: 700;
    color: #1a202c;
    letter-spacing: -0.3px;
}

.related-article h6 a {
    font-family: var(--font-sans);
    font-weight: 600;
    color: #2d3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-article h6 a:hover {
    color: var(--primary);
}

.related-article p {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.6;
}

.badge {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.35em 0.75em;
}

/* Form Styles */
.article-form {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.form-label {
    display: block;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #f3f4f6;
}

/* Responsive design */
@media (max-width: 991.98px) {
    .article-title {
        font-size: 2.5rem;
    }
    
    .article-content {
        font-size: 1.15rem;
        line-height: 1.8;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .articles-container {
        padding: 0 0.5rem;
    }
    
    .article-title {
        font-size: 2.25rem; /* 36px */
        line-height: 1.2;
    }
    
    .article-excerpt {
        font-size: 1.25rem;
        line-height: 1.6;
        padding-left: 1.25rem;
    }
    
    .article-header {
        padding: 1.5rem 1.5rem 0.5rem;
    }
    
    .article-content {
        padding: 0 1.5rem 2.5rem;
        font-size: 1.3rem; /* 20.8px */
        line-height: 1.75;
    }
    
    .article-content h2 {
        font-size: 1.75rem;
        margin: 2.5rem 0 1.25rem;
    }
    
    .article-content h3 {
        font-size: 1.7rem; /* 27.2px */
        margin: 2rem 0 1.25rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .article-body {
        padding: 1rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .modern-articles-page {
        padding: 1rem 0;
    }
}