﻿/* ===== Brand Variables ===== */
:root {
    --brand-primary: #FFECE2;
    --brand-primary-hover: #f7ddd1;
    --brand-success: #D9F8FF;
    --brand-success-hover: #cceff7;
    --brand-danger: #E2D4CA;
    --brand-danger-hover: #d8c7bc;
    --brand-lilac: #eadfff;
    --brand-accent: #40b7d4;
    --text-main: #222222;
    --brand-text-dark: #2f2a35;
    --brand-text-muted: #5f5668;
}

/* ===== Auth Page Links ===== */
.auth-page a:not(.btn) {
    color: var(--text-main) !important;
    text-decoration: none;
}

    .auth-page a:not(.btn):hover,
    .auth-page a:not(.btn):focus {
        color: var(--brand-accent) !important;
        text-decoration: none;
    }

/* ===== Buttons ===== */
.btn {
    border-radius: 10px;
    padding: 6px 14px;
    transition: all 0.2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

/* Primary */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-text-dark);
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active {
        background-color: var(--brand-primary-hover) !important;
        border-color: var(--brand-primary-hover) !important;
        color: var(--brand-text-dark) !important;
        box-shadow: none !important;
    }

/* Success */
.btn-success {
    background-color: var(--brand-success);
    border-color: var(--brand-success);
    color: var(--brand-text-dark);
}

    .btn-success:hover,
    .btn-success:focus,
    .btn-success:active {
        background-color: var(--brand-success-hover) !important;
        border-color: var(--brand-success-hover) !important;
        color: var(--brand-text-dark) !important;
        box-shadow: none !important;
    }

/* Danger */
.btn-danger {
    background-color: var(--brand-danger);
    border-color: var(--brand-danger);
    color: var(--brand-text-dark);
}

    .btn-danger:hover,
    .btn-danger:focus,
    .btn-danger:active {
        background-color: var(--brand-danger-hover) !important;
        border-color: var(--brand-danger-hover) !important;
        color: var(--brand-text-dark) !important;
        box-shadow: none !important;
    }

/* Outline buttons */
.btn-outline-primary {
    border-color: var(--brand-primary);
    color: var(--brand-text-muted);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:active {
        background-color: var(--brand-primary) !important;
        border-color: var(--brand-primary) !important;
        color: var(--brand-text-dark) !important;
        box-shadow: none !important;
    }

.btn-outline-danger {
    border-color: var(--brand-danger);
    color: var(--brand-text-muted);
}

    .btn-outline-danger:hover,
    .btn-outline-danger:focus,
    .btn-outline-danger:active {
        background-color: var(--brand-danger) !important;
        border-color: var(--brand-danger) !important;
        color: var(--brand-text-dark) !important;
        box-shadow: none !important;
    }

.btn-outline-secondary {
    border-color: #d9d9d9;
    color: #666;
    background-color: transparent;
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:active {
        background-color: #f3f3f3 !important;
        border-color: #d9d9d9 !important;
        color: #333 !important;
        box-shadow: none !important;
    }

/* ===== Forms ===== */
.form-control,
.form-select {
    border-radius: 10px;
    border-color: #e6e6e6;
    box-shadow: none;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--brand-primary);
        box-shadow: 0 0 0 0.2rem rgba(234, 223, 255, 0.35);
    }

/* ===== Dropdown ===== */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
}

    .dropdown-item:hover {
        background-color: #f6f1ff;
    }

/* ===== Footer ===== */
.footer {
    background-color: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(8px);
    color: #5f5668;
}

    .footer a,
    .footer a:link,
    .footer a:visited,
    .footer a:active {
        color: #5f5668 !important;
        text-decoration: none;
    }

        .footer a:hover,
        .footer a:focus {
            color: var(--brand-accent) !important;
        }

html.dark-mode .footer {
    color: #e5e7eb;
}

/* ===== Theme Toggle ===== */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: 1rem;
    color: var(--brand-text-muted);
    font-weight: 500;
}

    .theme-toggle .form-check-input {
        cursor: pointer;
    }

    .theme-toggle .form-check-label {
        cursor: pointer;
        user-select: none;
    }

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #eadfff 0%, #d9f8ff 50%, #e2d4ca 100%);
    border-radius: 24px;
    padding: 4rem 2rem;
    margin: 2rem auto 0 auto;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.75);
    color: #5f5668;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
    color: #2f2a35;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #4c4653;
    max-width: 640px;
    margin: 0 auto 1.75rem auto;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#latest-posts {
    margin-top: 1rem;
}

/* ===== About Page ===== */
.about-hero {
    background: linear-gradient(135deg, #eadfff 0%, #f7f1ff 45%, #d9f8ff 100%);
    border-radius: 24px;
    padding: 4rem 2rem;
    margin: 2rem auto 0 auto;
    position: relative;
    overflow: hidden;
}

.about-hero-content {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.about-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.78);
    color: #5f5668;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
}

.about-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 700;
    line-height: 1.15;
    color: #2f2a35;
    margin-bottom: 1rem;
}

.about-subtitle {
    font-size: 1.05rem;
    color: #4c4653;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-card {
    border: none;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 650;
    color: #2f2a35;
}

.about-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.about-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background-color: #f6f1ff;
    color: #564d61;
    font-size: 0.95rem;
    font-weight: 500;
}

.about-list {
    padding-left: 1.2rem;
    color: #555;
    line-height: 1.8;
}

.about-closing {
    max-width: 720px;
    margin: 0 auto;
    color: #4c4653;
    line-height: 1.7;
    font-size: 1.02rem;
}

/* ===== Editor ===== */
.editor-hero {
    background: linear-gradient(135deg, #eadfff 0%, #f7f1ff 45%, #d9f8ff 100%);
    border-radius: 24px;
    padding: 3rem 2rem;
    margin: 2rem auto 0 auto;
    overflow: hidden;
}

.editor-hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.editor-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.78);
    color: #5f5668;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.editor-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: #2f2a35;
    margin-bottom: 0.85rem;
}

.editor-subtitle {
    font-size: 1.02rem;
    color: #4c4653;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

.editor-card {
    border: none;
    margin-bottom: 2rem;
}

.editor-label {
    font-weight: 600;
    color: #2f2a35;
}

.editor-textarea {
    min-height: 320px;
}

/* Froala */
.fr-box {
    border-radius: 14px !important;
    border: 1px solid #e9e9e9 !important;
    overflow: hidden;
}

.fr-toolbar {
    background: #fcfbff !important;
    border-bottom: 1px solid #efefef !important;
}

.fr-wrapper {
    background: #ffffff !important;
}

.fr-element {
    color: #333 !important;
    line-height: 1.8;
}

/* Editor image previews */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.image-preview-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f8f8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.image-preview-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.single-preview-wrapper {
    width: 100%;
    max-width: 280px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f8f8;
}

.single-preview-img {
    width: 100%;
    height: 180px;
    display: block;
    object-fit: cover;
}

/* ===== Blog Metadata ===== */
.blog-badge {
    background-color: #f4f1ff;
    color: #5f5668;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.blog-new-badge {
    background-color: #d9f8ff;
    color: #355b63;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.blog-meta {
    font-size: 0.85rem;
    color: #777;
}

.blog-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.blog-details-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-author-badge {
    background: #f4f1ff;
    color: #5f5668;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.blog-details-info {
    font-size: 0.9rem;
    color: #777;
}

.blog-details-image {
    width: 100%;
    max-height: 420px;
    display: block;
    object-fit: cover;
}

/* ===== Blog Cards ===== */
.blog-card {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

    .blog-card:hover,
    .blog-card:focus-within {
        transform: translateY(-8px);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
    }

.blog-card-image {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
}

/* ===== Dashboard ===== */
.dashboard-card {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

    .dashboard-card:hover,
    .dashboard-card:focus-within {
        transform: translateY(-8px);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
    }

        .dashboard-card:hover .blog-card-image,
        .dashboard-card:focus-within .blog-card-image {
            transform: scale(1.02);
        }

    .dashboard-card .card-body {
        display: flex;
        flex-direction: column;
    }

    .dashboard-card .btn-sm {
        padding: 6px 12px;
        border-radius: 9px;
    }

.card-body p {
    color: #000 !important;
}

.dashboard-subtitle {
    color: #000 !important;
}

/* ===== Tutorials ===== */
.tutorial-card {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

    .tutorial-card:hover,
    .tutorial-card:focus-within {
        transform: translateY(-8px);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
    }

.tutorial-card-image {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.tutorial-card:hover .tutorial-card-image,
.tutorial-card:focus-within .tutorial-card-image {
    transform: scale(1.02);
}

.tutorial-card .card-body {
    display: flex;
    flex-direction: column;
}

.tutorial-meta-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tutorial-difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #f6f1ff;
    color: #5f5668;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tutorial details */
.tutorial-details-card {
    border: none;
    overflow: hidden;
}

.tutorial-details-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.tutorial-content {
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

    .tutorial-content h1,
    .tutorial-content h2,
    .tutorial-content h3,
    .tutorial-content h4 {
        color: #2f2a35;
        margin-top: 1.5rem;
        margin-bottom: 0.8rem;
    }

    .tutorial-content p {
        margin-bottom: 1rem;
    }

    .tutorial-content pre {
        background: #1f1f24;
        color: #f3f3f3;
        padding: 1rem;
        border-radius: 12px;
        overflow-x: auto;
        margin: 1.25rem 0;
    }

    .tutorial-content code {
        font-family: Consolas, Monaco, monospace;
    }

    .tutorial-content img {
        max-width: 100%;
        height: auto;
        border-radius: 12px;
    }

/* ===== Scroll To Top Button ===== */
.scroll-to-top-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #eadfff 0%, #d9f8ff 100%);
    color: #4b4453;
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1050;
}

    .scroll-to-top-btn:hover {
        transform: translateY(0) scale(1.04);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
    }

    .scroll-to-top-btn:focus {
        outline: none;
        box-shadow: 0 0 0 4px rgba(234, 223, 255, 0.55), 0 10px 24px rgba(0, 0, 0, 0.12);
    }

    .scroll-to-top-btn.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

/* ===== Identity Manage ===== */
.manage-page .editor-card,
.manage-nav-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.manage-shell-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2f2a35;
    margin-bottom: 0.35rem;
}

.manage-shell-subtitle {
    color: #5f5668;
    margin-bottom: 0;
}

.manage-nav-list .nav-link {
    color: #5d5568;
    border-radius: 12px;
    margin-bottom: 0.4rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

    .manage-nav-list .nav-link.active {
        background: #eadfff;
        color: #2f2a35;
    }

    .manage-nav-list .nav-link:hover {
        background: #f6f1ff;
        color: #2f2a35;
    }

.manage-page .form-control,
.manage-page .form-select {
    border-radius: 14px;
    border: 1px solid #e7e1ee;
    min-height: 48px;
    box-shadow: none;
}

    .manage-page .form-control:focus,
    .manage-page .form-select:focus {
        border-color: #d9c8f2;
        box-shadow: 0 0 0 0.2rem rgba(234, 223, 255, 0.45);
    }

.manage-page .btn-primary {
    border: none;
    background: linear-gradient(135deg, #eadfff 0%, #d9f8ff 100%);
    color: #3f3948;
    font-weight: 600;
    border-radius: 12px;
    padding: 0.7rem 1.2rem;
}

    .manage-page .btn-primary:hover {
        color: #2f2a35;
        transform: translateY(-1px);
    }

.manage-page .text-danger {
    font-size: 0.9rem;
}

.manage-theme-description {
    color: #6c757d;
}

html.dark-mode .manage-theme-description {
    color: #fff;
}

/* ===== Navbar Auth Buttons ===== */
.auth-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .auth-nav .nav-item {
        display: flex;
        align-items: center;
    }

    .auth-nav form {
        display: flex;
        margin: 0;
    }

.navbar .auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.375rem 0.875rem;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background-color: transparent;
    color: #333;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.navbar button.auth-btn {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;
}

.auth-btn span {
    display: inline-flex;
    align-items: center;
    font-weight: 300;
    color: inherit;
}

.navbar .auth-btn:hover,
.navbar .auth-btn:focus,
.navbar .auth-btn:active {
    background-color: #f3f3f3;
    border-color: #d9d9d9;
    color: #333;
    text-decoration: none;
    box-shadow: none;
    transform: translateY(-1px);
}

.navbar .auth-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(234, 223, 255, 0.35);
}

.auth-btn-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

/* ===== Blog Delete Page ===== */
.blog-delete-page {
    padding: 2rem 0;
}

.blog-delete-card {
    max-width: 950px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    overflow: hidden;
}

.blog-delete-header {
    padding: 2rem 2rem 1rem;
}

.blog-delete-label {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.8rem;
    background: #ffe7e7;
    color: #7a1f1f;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.blog-delete-title {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    color: #111;
}

.blog-delete-subtitle {
    margin-bottom: 0;
    color: #666;
    font-size: 1rem;
}

.blog-delete-preview {
    padding: 0 2rem 1.5rem;
}

.blog-delete-image {
    width: 100%;
    max-width: 420px;
    display: block;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.blog-delete-content {
    padding: 0 2rem 2rem;
}

.blog-delete-meta {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-delete-field {
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 1rem 1.25rem;
}

.blog-delete-field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #777;
}

.blog-delete-field-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    word-break: break-word;
}

.blog-delete-post-preview {
    max-height: 300px;
    overflow: auto;
    color: #222;
    line-height: 1.7;
}

.delete-post-preview {
    min-height: 320px;
    height: auto;
    overflow: auto;
    white-space: normal;
}

.blog-delete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.blog-btn-danger {
    background: #111;
    border: 1px solid #111;
    color: #fff;
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    transition: 0.2s ease;
}

    .blog-btn-danger:hover {
        background: #2b2b2b;
        border-color: #2b2b2b;
        color: #fff;
    }

.blog-btn-secondary {
    background: #f3f3f3;
    border: 1px solid #ddd;
    color: #111;
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    transition: 0.2s ease;
}

    .blog-btn-secondary:hover {
        background: #e8e8e8;
        border-color: #d2d2d2;
        color: #111;
    }

/* ===== Category Cards ===== */
.category-card {
    display: block;
    border: 0;
    border-radius: 1rem;
    background: #fff;
    color: #222;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .category-card:hover,
    .category-card:focus {
        transform: translateY(-6px);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
        color: #222;
        text-decoration: none;
    }

    .category-card .card-body {
        padding: 1.5rem;
    }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .blog-delete-header,
    .blog-delete-preview,
    .blog-delete-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .blog-delete-title {
        font-size: 1.6rem;
    }

    .blog-delete-image {
        max-width: 100%;
    }

    .single-preview-wrapper {
        max-width: 220px;
    }

    .single-preview-img {
        height: 150px;
    }

    .blog-card-image {
        height: 200px;
    }

    .blog-details-image {
        max-height: 260px;
    }
}
