/* Custom admin styling */
:root {
    --admin-bg: #000000;
    --admin-panel: #000000;
    --admin-border: rgba(255,255,255,0.06);
    --admin-text: #e7eef6;
    --admin-text-muted: rgba(255,255,255,0.6);
    --accent-cyan: #00c7ff;
    --accent-cyan-bright: #00d4ff;
}

* {
    box-sizing: border-box;
}

body { 
    background: #000000;
    color: var(--admin-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.navbar-brand { 
    font-weight: 800; 
    letter-spacing: 0.05em;
    font-size: 1.25rem;
}

/* Cards and containers */
.card { 
    background: #000000;
    border: 1px solid var(--admin-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.625rem;
}

.card:hover {
    border-color: rgba(0, 199, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 199, 255, 0.1);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

/* Form controls */
.form-control,
.form-select,
textarea.form-control { 
    background: #000000;
    color: #ffffff !important;
    border: 1.5px solid var(--admin-border);
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
}

.form-control::placeholder {
    color: rgba(255,255,255,0.3);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus { 
    background: #000000;
    color: #ffffff !important;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0, 199, 255, 0.15);
    outline: none;
}

textarea.form-control {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Form labels */
label {
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--admin-text);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label.required::after { 
    content: ' *'; 
    color: #ff6b6b;
}

/* Form groups and spacing */
.mb-3 {
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-text,
.small-help { 
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
    font-weight: 400;
}

code {
    background: rgba(0, 199, 255, 0.1);
    color: var(--accent-cyan-bright);
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 199, 255, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #0099cc 100%);
    border-color: transparent;
    color: #000;
    box-shadow: 0 6px 20px rgba(0, 199, 255, 0.25);
    font-weight: 700;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-cyan-bright) 0%, #00aad8 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 199, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 199, 255, 0.3);
}

.btn-primary.btn-lg {
    padding: 1rem 2rem;
    font-size: 0.95rem;
}

/* Success button */
.btn-success {
    background: linear-gradient(135deg, #198754 0%, #138649 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #20a058 0%, #159850 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.35);
}

.btn-success:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.25);
}

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e74c5c 0%, #d63344 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.35);
}

.btn-danger:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

/* Outline buttons */
.btn-outline-primary {
    background-color: transparent;
    color: var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
    box-shadow: none;
}

.btn-outline-primary:hover {
    background-color: rgba(0, 199, 255, 0.12);
    border-color: var(--accent-cyan-bright);
    color: var(--accent-cyan-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 199, 255, 0.25);
}

.btn-outline-primary:active {
    background-color: rgba(0, 199, 255, 0.2);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--admin-text-muted);
    border: 2px solid var(--admin-border);
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background-color: rgba(108, 117, 125, 0.1);
    border-color: var(--admin-text-muted);
    color: var(--admin-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-outline-secondary:active {
    background-color: rgba(108, 117, 125, 0.2);
}

/* Small buttons */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    text-transform: capitalize;
}

/* Admin breadcrumb */
.admin-breadcrumb { 
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.admin-breadcrumb a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
}

.admin-breadcrumb a:hover {
    color: var(--accent-cyan-bright);
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-published { 
    background: linear-gradient(135deg, #198754 0%, #138649 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

.badge-draft { 
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, #198754 0%, #138649 100%);
    color: #fff;
}

/* Admin and Dashboard actions */
.admin-actions,
.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--admin-border);
    flex-wrap: wrap;
}

.admin-actions .btn,
.dashboard-actions .btn { 
    min-width: 120px;
}

/* Main container */
.container.py-4 { 
    max-width: 1000px;
    padding-top: 2.5rem !important;
    padding-bottom: 3.5rem !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--admin-text);
}

h1.h3,
.h3 {
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

h5 {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--admin-text);
}

.text-light {
    color: var(--admin-text) !important;
}

.text-muted {
    color: var(--admin-text-muted) !important;
}

.small {
    font-size: 0.875rem;
}

/* Post list card layout */
.card-body.d-flex {
    padding: 1.5rem;
}

.admin-actions form {
    display: inline;
    margin: 0;
}

/* Alert adjustments */
.alert {
    border-radius: 0.625rem;
    border: 1.5px solid rgba(255,255,255,0.1);
    padding: 1.25rem 1.5rem;
    font-weight: 500;
}

.alert-info {
    background: linear-gradient(135deg, rgba(0, 199, 255, 0.08) 0%, rgba(0, 199, 255, 0.04) 100%);
    border-color: rgba(0, 199, 255, 0.25);
    color: var(--accent-cyan-bright);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08) 0%, rgba(220, 53, 69, 0.04) 100%);
    border-color: rgba(220, 53, 69, 0.25);
    color: #ff9999;
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.08) 0%, rgba(25, 135, 84, 0.04) 100%);
    border-color: rgba(25, 135, 84, 0.25);
    color: #9fdf9f;
}

.alert-link {
    color: currentColor;
    text-decoration: underline;
    font-weight: 700;
}

/* Form row spacing */
.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
}

/* Section headers with dividers */
.section-divider {
    border-bottom: 2px solid var(--admin-border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

/* Post content display */
.post-content {
    line-height: 1.8;
    color: var(--admin-text);
}

.post-content p {
    margin-bottom: 1rem;
}

/* Input groups */
.input-group-text {
    background: #000000 !important;
    border: 1.5px solid var(--admin-border) !important;
    color: var(--admin-text-muted) !important;
    padding: 0.75rem 1rem;
}

.input-group .form-control {
    border-left: none !important;
}

.input-group .form-control:focus {
    border-left: 1.5px solid var(--accent-cyan) !important;
    margin-left: -1.5px;
}

.input-group:focus-within .input-group-text {
    border-color: var(--accent-cyan) !important;
}

/* Form switches */
.form-switch-lg {
    padding-left: 3rem;
}

.form-switch-lg .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    margin-left: -3rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1.5px solid var(--admin-border);
}

.form-switch-lg .form-check-input:checked {
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.form-switch-lg .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(0, 199, 255, 0.15);
    border-color: var(--accent-cyan);
}

.form-switch-lg .form-check-label {
    font-weight: 600;
    color: var(--admin-text);
    cursor: pointer;
}

/* Card body padding adjustments */
.card-body.p-4 {
    padding: 2rem !important;
}

@media (max-width: 768px) {
    .card-body.p-4 {
        padding: 1.5rem !important;
    }
    
    .section-divider {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* CKEditor Dark Theme Overrides */
.ck.ck-editor__main > .ck-editor__editable {
    background-color: #000000 !important;
    color: #e9eef2 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.ck.ck-editor__main > .ck-editor__editable:focus {
    border-color: #00c7ff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 199, 255, 0.25) !important;
}
.ck.ck-toolbar {
    background-color: #000000 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.ck.ck-button {
    color: #e9eef2 !important;
}
.ck.ck-button:hover, .ck.ck-button.ck-on {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}
.ck.ck-dropdown__panel {
    background-color: #000000 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.ck.ck-list__item .ck-button:hover {
    background-color: #00c7ff !important;
}
/* Fix for content height */
.ck-editor__editable_inline {
    min-height: 300px;
}