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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Navbar */
.navbar {
    width: 100%;
    padding: 18px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #0f172a;
    font-size: 22px;
    font-weight: 700;
}

.logo-icon {
    font-size: 24px;
    color: #2563eb;
}

.logo-text {
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-link {
    text-decoration: none;
    color: #334155;
    font-size: 16px;
    font-weight: 500;
    transition: 0.3s ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* Homepage */
.hero-center {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}

.hero-subtitle {
    font-size: 20px;
    color: #64748b;
}

.hero-btn {
    display: inline-block;
    margin-top: 22px;
    text-decoration: none;
    background: #2563eb;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: 0.3s ease;
}

.hero-btn:hover {
    background: #1d4ed8;
}

/* Common page section */
.page-section {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
}

.section-header {
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 32px;
    color: #0f172a;
}

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

/* Buttons */
.add-btn,
.card-btn,
.small-btn,
.auth-btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
}

.add-btn {
    background: #2563eb;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
}

.add-btn:hover {
    background: #1d4ed8;
}

.card-btn {
    margin-top: 18px;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.card-btn:hover {
    background: #1e293b;
}

.small-btn {
    background: #e2e8f0;
    color: #0f172a;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.small-btn:hover {
    background: #cbd5e1;
}

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

.danger-btn:hover {
    background: #fecaca;
}

/* Grid cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: auto;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.card-title {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 14px;
}

.card-content {
    color: #475569;
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 16px;
}

.card-content p {
    margin: 0;
}

.card-author {
    margin-top: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.card-view-btn {
    width: fit-content;
    margin-top: 0;
    align-self: flex-start;
}

.profile-card-actions {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-card-left,
.profile-card-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-card-right {
    margin-left: auto;
}

.profile-view-btn {
    margin-top: 0;
    width: fit-content;
    align-self: auto;
}

.delete-form {
    margin: 0;
}

.delete-form button {
    border: none;
    cursor: pointer;
}

/* Empty states */
.empty-state,
.empty-center {
    width: 100%;
    text-align: center;
    color: #64748b;
    font-size: 18px;
    padding: 40px 0;
}

.empty-center {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Blog details */
.details-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.details-title {
    font-size: 36px;
    color: #0f172a;
    margin-bottom: 18px;
}

.details-content {
    color: #334155;
    font-size: 17px;
    line-height: 1.9;
    margin-bottom: 18px;
}

.details-author {
    color: #64748b;
    font-weight: 600;
    margin-bottom: 30px;
}

.comments-section {
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}

.comments-section h3 {
    font-size: 24px;
    margin-bottom: 18px;
    color: #0f172a;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.comment-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: 0.3s ease;
}

.comment-input:focus {
    border-color: #2563eb;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px;
}

.comment-item p {
    color: #1e293b;
    margin-bottom: 6px;
}

.comment-item small,
.no-comments {
    color: #64748b;
}

.comment-login-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-login-message p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.comment-login-link {
    text-decoration: none;
    background: #2563eb;
    color: #ffffff;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.comment-login-link:hover {
    background: #1d4ed8;
}

.comments-section {
    margin-top: 28px;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}

.comments-title {
    font-size: 24px;
    color: #0f172a;
    margin-bottom: 18px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.comment-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: 0.3s ease;
}

.comment-input:focus {
    border-color: #2563eb;
}

.comment-btn-wrap {
    display: flex;
    justify-content: flex-end;
}

.comment-submit-btn {
    width: auto;
    min-width: unset;
    max-width: max-content;
    align-self: flex-end;
    display: inline-block;
    border: none;
    cursor: pointer;
    background: #010203;
    color: #ffffff;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.comment-submit-btn:hover {
    background: #1d4ed8;
}

.comment-display-section {
    margin-top: 10px;
}

.comment-list-title {
    font-size: 18px;
    color: #0f172a;
    margin-bottom: 14px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px;
}

.comment-item p {
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.6;
}

.comment-item small {
    color: #64748b;
}

.no-comments {
    color: #64748b;
    font-size: 15px;
}

.blog-meta-bar {
    margin: 24px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.like-count-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 12px;
}

.meta-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.meta-value {
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
}

.like-btn {
    display: inline-block;
    text-decoration: none;
    background: #2563eb;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.like-btn:hover {
    background: #1d4ed8;
}

.unlike-btn {
    background: #ef4444;
}

.unlike-btn:hover {
    background: #dc2626;
}

.login-like-btn {
    background: #0f172a;
}

.login-like-btn:hover {
    background: #1e293b;
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 34px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.auth-title {
    font-size: 30px;
    color: #0f172a;
    margin-bottom: 24px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 22px;
}

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

.auth-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: 0.3s ease;
}

.auth-input:focus {
    border-color: #2563eb;
}

.auth-btn {
    background: #2563eb;
    color: #ffffff;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}

.auth-btn:hover {
    background: #1d4ed8;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 16px 20px;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .section-header-space {
        flex-direction: column;
        align-items: flex-start;
    }

    .details-card,
    .auth-card {
        padding: 24px;
    }
}

/*Add Edit post*/
.form-page-header {
    margin-bottom: 24px;
}

.form-page-header h2 {
    font-size: 32px;
    color: #0f172a;
    margin-bottom: 8px;
}

.form-page-subtitle {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

.blog-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.blog-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

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

.form-label {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: 0.3s ease;
    background: #ffffff;
}

.form-input:focus {
    border-color: #2563eb;
}

/* CKEditor wrapper if rendered by Django form */
.form-group .django-ckeditor-widget,
.form-group .ck-editor,
.form-group .ck-editor__editable {
    width: 100%;
}

/* Editor outer area */
.form-group .ck-editor__editable {
    min-height: 280px;
}

/* Fallback textarea styling if editor does not load */
.form-group textarea {
    width: 100%;
    min-height: 280px;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    resize: vertical;
    transition: 0.3s ease;
    background: #ffffff;
}

.form-group textarea:focus {
    border-color: #2563eb;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.primary-btn,
.secondary-btn {
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.primary-btn {
    background: #2563eb;
    color: #ffffff;
}

.primary-btn:hover {
    background: #1d4ed8;
}

.secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.secondary-btn:hover {
    background: #cbd5e1;
}

@media (max-width: 768px) {
    .blog-form-card {
        padding: 22px;
    }

    .form-page-header h2 {
        font-size: 26px;
    }

    .form-actions {
        justify-content: stretch;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        text-align: center;
    }
}

.page-section {
    width: 90%;
    max-width: 1200px;
    margin: 50px auto 80px;
}

.form-page-header {
    max-width: 900px;
    margin: 0 auto 24px;
}

.form-page-header h2 {
    font-size: 32px;
    color: #0f172a;
    margin-bottom: 8px;
}

.form-page-subtitle {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

.blog-form-card {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.blog-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-bottom: 4px;
}

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

.form-label {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: 0.3s ease;
    background: #ffffff;
}

.form-input:focus {
    border-color: #2563eb;
}

.editor-wrapper textarea {
    width: 100%;
    min-height: 280px;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    resize: vertical;
}

.editor-wrapper .ck-editor__editable {
    min-height: 280px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.primary-btn {
    background: #2563eb;
    color: #ffffff;
}

.primary-btn:hover {
    background: #1d4ed8;
}

.secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.secondary-btn:hover {
    background: #cbd5e1;
}