/* Admin Panel Styles */
.admin-body {
    background: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: #1f2937;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: #374151;
    color: white;
}

.nav-item i {
    width: 18px;
    text-align: center;
}

/* Main Content */
.admin-main {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
}

.admin-user {
    color: #64748b;
    font-weight: 500;
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #64748b;
    font-weight: 500;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* Posts List */
.posts-list {
    margin-bottom: 1.5rem;
}

.post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.post-item:last-child {
    border-bottom: none;
}

.post-info h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.category {
    color: #2563eb;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.date {
    color: #64748b;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.action-card:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-2px);
}

.action-card i {
    font-size: 1.5rem;
}

/* Forms */
.post-form {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Posts Table */
.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.posts-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.posts-table-wrapper {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.posts-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.posts-table tr:last-child td {
    border-bottom: none;
}

.posts-table tr:hover {
    background: #f8fafc;
}

.category-badge {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* Button Styles */
.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* No Posts State */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.no-posts i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.no-posts p {
    color: #64748b;
    font-size: 1.125rem;
}

.no-posts a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

/* Account Settings */
.account-settings {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.settings-card,
.info-card {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.settings-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.settings-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-header p {
    color: #64748b;
    margin: 0;
}

.account-form .form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.account-form .form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.form-help {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.form-group small {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 500;
    color: #374151;
}

.info-item span {
    color: #64748b;
}

.role-badge {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.security-tips {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.security-tips h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-tips li {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.security-tips li:before {
    content: '•';
    color: #2563eb;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Categories Management */
.categories-management {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.categories-form-section {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.form-card {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

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

.categories-list-section {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.categories-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.categories-count {
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
}

.categories-table-wrapper {
    overflow-x: auto;
}

.categories-table {
    width: 100%;
    border-collapse: collapse;
}

.categories-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.categories-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.categories-table tr:last-child td {
    border-bottom: none;
}

.categories-table tr:hover {
    background: #f8fafc;
}

.categories-table tr.editing {
    background: #fef3c7;
}

.categories-table tr.editing:hover {
    background: #fde68a;
}

.category-slug {
    margin-top: 0.25rem;
}

.category-slug small {
    color: #64748b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
}

.category-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.post-count-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-disabled {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-disabled:hover {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
    transform: none !important;
}

.no-categories {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.no-categories i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-categories p {
    font-size: 1.125rem;
    margin: 0;
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .account-settings {
        grid-template-columns: 1fr;
    }
    
    .categories-management {
        grid-template-columns: 1fr;
    }
    
    .categories-form-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .posts-table-wrapper {
        overflow-x: auto;
    }
    
    .posts-table {
        min-width: 600px;
    }
    
    .posts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .categories-table-wrapper {
        overflow-x: auto;
    }
    
    .categories-table {
        min-width: 600px;
    }
    
    .categories-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}