.admin-page {
    background: #f6f8fb;
    min-height: 100vh;
}

.admin-main {
    padding-top: 110px;
    padding-bottom: 56px;
}

.admin-page-header {
    /* max-width: 760px; */
    margin: 0 auto 1.75rem;
    text-align: left;
}

.admin-page-eyebrow {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(57, 136, 141, 0.1);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.admin-page-header h1 {
    color: var(--primary-color);
    font-weight: 800;
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1.15;
}

.admin-panel {
    padding: 24px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(18, 38, 63, 0.08);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.admin-panel #resetBtn.btn-secondary {
    background: #eef2f6;
    color: #243446;
    border: 1px solid rgba(36, 52, 70, 0.18);
}

.admin-panel #resetBtn.btn-secondary:hover {
    background: #e2e8ef;
    color: #1b2a3a;
    border-color: rgba(27, 42, 58, 0.3);
    transform: translateY(-1px);
}

.admin-action-card {
    display: block;
    height: 100%;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid rgba(18, 38, 63, 0.08);
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
    border-color: rgba(57, 136, 141, 0.22);
    color: inherit;
}

.admin-action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(57, 136, 141, 0.12), rgba(44, 108, 112, 0.08));
    color: var(--primary-color);
    font-size: 1.25rem;
}

.admin-action-card h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.admin-action-card p {
    color: var(--dark);
    margin-bottom: 14px;
    line-height: 1.6;
}

.admin-action-link {
    font-weight: 700;
    color: var(--primary-color);
}

.admin-hint-card {
    padding: 20px 24px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(18, 38, 63, 0.08);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.admin-hint-card ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.admin-hint-card li + li {
    margin-top: 8px;
}

.admin-toolbar {
    padding: 20px 22px;
    background: #ffffff;
    border: 1px solid rgba(18, 38, 63, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.admin-toolbar .form-label {
    letter-spacing: 0.04em;
}

.admin-toolbar .form-control,
.admin-toolbar .form-select {
    border-color: rgba(18, 38, 63, 0.12);
    box-shadow: none;
}

.admin-toolbar .form-control:focus,
.admin-toolbar .form-select:focus {
    border-color: rgba(57, 136, 141, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(57, 136, 141, 0.12);
}

.admin-toolbar .input-group-text {
    border-color: rgba(18, 38, 63, 0.12);
    color: #7a8794;
}

.admin-toolbar-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(18, 38, 63, 0.08);
}

.articles-empty-state {
    padding: 36px 20px;
    text-align: center;
    color: #6b7280;
}

.article-item {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(18, 38, 63, 0.08);
    padding: 18px;
    margin-bottom: 14px;
    background: #ffffff;
    min-width: 0;
}

.article-thumb-wrap {
    width: 140px;
    flex: 0 0 140px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
    border: 1px solid rgba(18, 38, 63, 0.08);
}

.article-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.article-item h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.article-item p {
    color: var(--dark);
    margin-bottom: 0;
    line-height: 1.6;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.admin-footer {
    background: #ffffff;
    border-top: 1px solid rgba(18, 38, 63, 0.08);
    color: #5f6b7a;
}

.admin-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.admin-footer a:hover {
    text-decoration: underline;
}

.admin-login-container {
    margin-top: 50px;
    padding: 28px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(18, 38, 63, 0.08);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.admin-login-container h2 {
    color: var(--primary-color);
    font-weight: 700;
}

/* Content Editor Styles */
.content-blocks {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    min-height: 300px;
    background: #f9f9f9;
}

.content-block {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 40px 15px 15px 15px; 
    margin-bottom: 15px;
    position: relative;
}

.content-block:hover {
    border-color: #007bff;
}

.block-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex !important;
    gap: 3px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    visibility: visible !important;
}

.block-controls button {
    padding: 4px 10px;
    font-size: 13px;
    min-width: 32px;
    font-weight: bold;
    line-height: 1.2;
    border: 1px solid #333 !important;
    background: #f8f9fa !important;
    color: #333 !important;
    cursor: pointer;
    display: inline-block !important;
}

.block-controls button.btn-danger {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.block-controls button:hover {
    opacity: 0.8;
}

.content-block textarea,
.content-block input[type="text"] {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    padding: 8px 0;
}

.text-editor {
    min-height: 100px;
    font-size: 1rem;
    line-height: 1.6;
}

.text-input-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    font-style: italic;
    color: #666;
}

.text-input-h1 {
    font-size: 2rem;
    font-weight: 700;
}

.text-input-h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-input-h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.text-input-h4 {
    font-size: 1.25rem;
    font-weight: 700;
}

.text-input-h5 {
    font-size: 1.1rem;
    font-weight: 700;
}

.text-input-h6 {
    font-size: 1rem;
    font-weight: 700;
}

.content-block.image-block {
    text-align: center;
}

.content-block.image-block img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
}

.image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#featuredImagePreview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    margin-top: 10px;
}

.article-item-content {
    min-width: 0;
    flex: 1;
}

.article-item .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
}

.article-item .article-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 768px) {
    .article-item {
        padding: 16px;
    }

    .article-item .d-flex {
        flex-wrap: nowrap;
    }

    .article-thumb-wrap {
        margin-top: 2px;
    }
}

@media (max-width: 767.98px) {
    .article-thumb-wrap {
        width: 100%;
        flex: 1 1 100%;
    }

    .article-actions {
        justify-content: flex-start;
    }
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.article-actions .btn {
    min-width: 82px;
}

.article-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

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

.alert-message {
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
}

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

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

.text-format-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    padding: 5px;
    background: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.text-format-toolbar button {
    padding: 5px 10px;
    min-width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.text-format-toolbar button:hover {
    background: #e8e8e8;
    border-color: #999;
}

.text-format-toolbar button:active {
    background: #ddd;
    border-color: #666;
}

.text-editor-rich {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    outline: none;
}

.text-editor-rich:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.text-editor-rich[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

.text-editor-rich-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    font-style: italic;
    color: #666;
}

.text-editor-rich-h1 {
    font-size: 2rem;
    font-weight: 700;
}

.tags-input-section {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background: #f9f9f9;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    padding: 0;
    margin: 0;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
}

.tag-remove:hover {
    opacity: 0.8;
}

#tagsInput {
    width: 100%;
    border: 1px solid #ddd !important;
    border-radius: 4px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px 0;
}

.tag-button {
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-button:hover {
    border-color: #007bff;
    background: #f0f6ff;
}

.tag-button.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tag-button.selected:hover {
    background: #0056b3;
    border-color: #0056b3;
}
.text-editor-rich-h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-editor-rich-h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.text-editor-rich-h4 {
    font-size: 1.25rem;
    font-weight: 700;
}

.text-editor-rich-h5 {
    font-size: 1.1rem;
    font-weight: 700;
}

.text-editor-rich-h6 {
    font-size: 1rem;
    font-weight: 700;
}