/* Reset and Base Styles */
:root {
    --primary-color: #1a8917;
    --primary-dark: #146b12;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #e9ecef;
    --text-muted: #6c757d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo:hover {
    color: var(--dark-color);
}

.logo-icon {
    font-size: 1.8rem;
}

.search-form {
    display: flex;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    padding: 10px 15px;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--border-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: var(--secondary-color);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--dark-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger {
    width: 24px;
    height: 2px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--dark-color);
}

.btn-outline:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.btn-text {
    background: transparent;
    color: var(--secondary-color);
    padding: 10px;
}

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

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5rem;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.blog-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.blog-card-link {
    color: inherit;
    display: block;
}

.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-color);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--secondary-color);
}

.blog-card-content {
    padding: 20px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.category-badge-lg {
    padding: 6px 15px;
    font-size: 14px;
}

.read-time {
    color: var(--text-muted);
}

.blog-card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card-excerpt {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.author-name {
    font-weight: 600;
    font-size: 14px;
}

.blog-date {
    color: var(--text-muted);
    font-size: 12px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--radius-lg);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.popular-blogs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popular-blog-item {
    display: block;
    padding: 10px;
    background: #fff;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.popular-blog-item:hover {
    background: var(--border-color);
}

.popular-blog-title {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
}

.popular-blog-views {
    font-size: 12px;
    color: var(--text-muted);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.category-item:hover,
.category-item.active {
    background: var(--border-color);
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.category-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.page-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* Blog Article */
.blog-article {
    max-width: 800px;
    margin: 0 auto;
}

.article-navigation {
    margin-bottom: 20px;
}

.back-link {
    color: var(--text-muted);
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color);
}

.article-header {
    margin-bottom: 30px;
}

.article-category {
    margin-bottom: 15px;
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-excerpt {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.article-meta {
    margin-bottom: 20px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.article-cover {
    margin-bottom: 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.article-content {
    margin-bottom: 40px;
}

.content-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-body p {
    margin-bottom: 20px;
}

.content-body h2 {
    font-size: 1.8rem;
    margin: 30px 0 15px;
}

.content-body h3 {
    font-size: 1.4rem;
    margin: 25px 0 12px;
}

.content-body ul,
.content-body ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-muted);
}

.content-body img {
    border-radius: var(--radius);
    margin: 20px 0;
}

.article-footer {
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.article-actions {
    display: flex;
    gap: 15px;
}

.related-articles {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.related-articles h2 {
    margin-bottom: 25px;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 20px;
}

.auth-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control-lg {
    padding: 15px;
    font-size: 16px;
}

select.form-control {
    cursor: pointer;
}

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

.form-text {
    font-size: 12px;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

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

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

/* Dashboard */
.dashboard-body {
    background: var(--light-color);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.dashboard-sidebar {
    background: #fff;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 260px;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius);
    color: var(--secondary-color);
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: #fff;
}

.nav-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.dashboard-main {
    padding: 30px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
}

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

.stats-grid-lg {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Dashboard Section */
.dashboard-section {
    background: #fff;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow-x: auto;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: var(--light-color);
}

.blog-title {
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.published {
    background: #d4edda;
    color: #155724;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Blog Form */
.blog-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cover-preview {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cover-preview img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Blog List (Search) */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-list-item {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-list-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.blog-list-link {
    display: grid;
    grid-template-columns: 250px 1fr;
    color: inherit;
}

.blog-list-image {
    width: 250px;
    height: 180px;
    overflow: hidden;
    background: var(--light-color);
}

.blog-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-list-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.blog-list-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.blog-list-excerpt {
    color: var(--text-muted);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.view-count {
    color: var(--text-muted);
    font-size: 13px;
}

/* Empty Search */
.empty-search {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-search h2 {
    margin-bottom: 10px;
}

.empty-search p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Category Header */
.category-header {
    text-align: center;
    padding: 50px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
}

.category-header h1 {
    font-size: 2.5rem;
    margin: 15px 0 10px;
}

.category-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Search Header */
.search-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.search-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.search-header p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.7);
}

.footer-section a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    font-size: 13px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

/* Blog Cover Thumbnail */
.blog-cover-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--light-color);
}

.blog-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-cover-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Large tablets and small desktops (max-width: 1400px) */
@media (max-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .content-grid {
        gap: 30px;
    }

    .stats-grid-lg {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Laptops (max-width: 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .sidebar {
        order: -1;
    }

    .stats-grid-lg {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-main {
        padding: 20px;
    }
}

/* Small laptops (max-width: 1366px) - Common laptop resolution */
@media (max-width: 1366px) and (min-width: 1025px) {
    .dashboard-sidebar {
        width: 220px;
    }
    
    .dashboard-main {
        margin-left: 220px;
    }
    
    .nav-item span:not(.nav-icon) {
        font-size: 0.9rem;
    }
}

/* Tablets and small laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dashboard-main {
        padding: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 1.4rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid-lg {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-list-link {
        grid-template-columns: 1fr;
    }

    .blog-list-image {
        width: 100%;
        height: 200px;
    }
    
    .dashboard-section {
        padding: 20px 15px;
    }
}

/* Large phones (max-width: 768px) */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        position: relative;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        gap: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .search-form {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 15px;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .hero {
        padding: 40px 15px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .article-cover img {
        max-height: 300px;
    }

    .content-body {
        font-size: 1rem;
    }

    .content-body h2 {
        font-size: 1.5rem;
    }

    .content-body h3 {
        font-size: 1.2rem;
    }

    .dashboard-header {
        gap: 10px;
    }

    .dashboard-header h1 {
        width: 100%;
        margin-bottom: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .table-container {
        border-radius: var(--radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Small phones (max-width: 576px) */
@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .navbar {
        padding: 10px 0;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .hero {
        padding: 30px 10px;
        border-radius: var(--radius);
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-header .btn {
        width: 100%;
    }

    .blog-card {
        border-radius: var(--radius);
    }

    .blog-card-image {
        height: 180px;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }

    .sidebar-widget {
        padding: 15px;
        border-radius: var(--radius);
    }

    .auth-card {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 20px 0;
    }

    .dashboard-main {
        padding: 20px 10px;
    }

    .dashboard-section {
        padding: 20px 15px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-excerpt {
        font-size: 1rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .blog-list-item {
        border-radius: var(--radius);
    }

    .blog-list-title {
        font-size: 1.2rem;
    }

    .category-header {
        padding: 30px 15px;
    }

    .category-header h1 {
        font-size: 1.8rem;
    }

    .search-header {
        padding: 30px 15px;
    }

    .search-header h1 {
        font-size: 1.5rem;
    }

    .footer {
        padding: 30px 0 15px;
        margin-top: 40px;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .social-links {
        flex-wrap: wrap;
    }
}

/* Extra small phones (max-width: 375px) */
@media (max-width: 375px) {
    .logo-text {
        display: none;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
        font-size: 12px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .dashboard-sidebar,
    .mobile-menu-btn,
    .mobile-sidebar-toggle,
    .mobile-sidebar-close,
    .dashboard-overlay,
    .footer,
    .btn,
    .action-buttons,
    .search-form {
        display: none !important;
    }

    .dashboard-main {
        margin-left: 0;
        padding: 0;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .blog-article {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .blog-card,
    .sidebar-widget,
    .stat-card,
    .dashboard-section {
        box-shadow: var(--shadow-sm);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
