/* Admin-specific styles */

.admin-body {
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

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

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

.login-form .btn {
    width: 100%;
    justify-content: center;
}

.login-error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
}

.back-link {
    color: #64748b;
    font-size: 0.875rem;
}

/* Admin Dashboard */
.admin-dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.admin-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo h1 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 0;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.nav-btn.active {
    background-color: #2563eb;
    color: white;
}

.view-blog {
    background-color: #10b981;
    color: white;
}

.view-blog:hover {
    background-color: #059669;
    color: white;
}

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

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

/* Admin Main Content */
.admin-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    width: 100%;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: #1e293b;
    margin-bottom: 0;
}

/* Posts List */
.posts-list {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.post-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

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

.post-item:hover {
    background-color: #f8fafc;
}

.post-info {
    flex: 1;
    min-width: 0;
}

.post-item-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-item-meta {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.post-status {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

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

.action-btn {
    padding: 0.375rem;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.action-btn.edit:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

.action-btn.delete:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Settings */
.settings-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.data-management {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.data-management h3 {
    margin-bottom: 1rem;
    color: #1e293b;
}

.data-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin-bottom: 0;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-body {
    padding: 1.5rem;
}

/* Post Form */
.post-form .form-group {
    margin-bottom: 1.5rem;
}

.post-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.post-form input,
.post-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

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

/* Image Upload */
.image-upload {
    border: 2px dashed #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.upload-area {
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    color: #64748b;
}

.upload-area:hover {
    border-color: #2563eb;
    background-color: #f8fafc;
}

.upload-area svg {
    margin-bottom: 1rem;
}

.image-preview {
    position: relative;
    padding: 1rem;
}

.image-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.remove-image {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Editor */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    background-color: #f8fafc;
}

.toolbar-btn {
    padding: 0.375rem 0.5rem;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.toolbar-btn.active {
    background-color: #2563eb;
    color: white;
}

.editor {
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 0.375rem 0.375rem;
    outline: none;
    line-height: 1.6;
    font-family: inherit;
}

.editor:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.editor[placeholder]:empty::before {
    content: attr(placeholder);
    color: #9ca3af;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    color: #1e293b;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .post-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .post-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .data-actions {
        flex-direction: column;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}
