/* ═══════════════════════════════════════════
   CONTENTRY LAB — BLOG & ADMIN CSS
   Apple-style, Glassmorphism, Premium feel
   ═══════════════════════════════════════════ */

/* --- BASE BLOG WRAPPER --- */
.blog-wrapper {
    padding-top: 140px;
    min-height: 100vh;
    background: var(--bg);
}

.blog-header {
    text-align: center;
    margin-bottom: 60px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

/* --- FEATURED BIG POST --- */
.featured-post {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

@media (min-width: 768px) {
    .featured-post {
        flex-direction: row;
        height: 400px;
    }
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(41, 151, 255, 0.1);
}

.featured-banner {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    min-height: 250px;
}

.featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.featured-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: #fff;
    line-height: 1.2;
}

/* --- POST CARD --- */
.post-card {
    background: transparent;
    border-radius: var(--radius);
    padding: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.post-card-inner {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.post-card-banner {
    width: 100%;
    height: 220px;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(41, 151, 255, 0.1);
}

.post-card:hover .post-card-inner {
    border-color: transparent;
}

.post-geo {
    font-size: 0.75rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.post-title {
    font-size: 1.4rem;
    color: var(--text);
    line-height: 1.3;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text2);
    line-height: 1.6;
    flex-grow: 1;
}

/* --- SINGLE POST --- */
.single-post-banner {
    width: 100vw;
    height: 40vh;
    min-height: 350px;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 40px;
    background-color: var(--surface2);
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

.single-post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

.single-post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    line-height: 1.2;
}

.single-post-meta {
    display: flex;
    gap: 20px;
    color: var(--text2);
    font-size: 0.9rem;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}

.single-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
}

.single-post-content h2, .single-post-content h3 {
    margin-top: 40px;
    margin-bottom: 16px;
    color: #fff;
}

.single-post-content img {
    border-radius: 12px;
    margin: 30px 0;
}

/* --- COMMENTS SECTION --- */
.comments-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.comments-header {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.comment {
    background: var(--surface2);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    position: relative;
}

.comment-delete {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: 0.2s;
}

.comment-delete:hover {
    opacity: 1;
    text-decoration: underline;
}

.comment-author {
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

.comment-box {
    background: var(--surface);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.comment-box textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 16px;
}

.comment-box textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.auth-notice {
    text-align: center;
    padding: 30px;
    background: rgba(41, 151, 255, 0.05);
    border: 1px dashed var(--blue);
    border-radius: 12px;
    color: var(--text2);
}

.auth-notice a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
}

/* --- ADMIN PANEL (WordPress style) --- */
.admin-layout {
    display: flex;
    height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-nav-item {
    padding: 12px 24px;
    color: var(--text2);
    font-weight: 500;
    transition: 0.3s;
    cursor: pointer;
}

.admin-nav-item:hover, .admin-nav-item.active {
    color: var(--blue);
    background: rgba(41, 151, 255, 0.1);
    border-right: 3px solid var(--blue);
}

.admin-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    background: var(--bg);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-title {
    font-size: 2rem;
}

/* --- NEW 2-COLUMN EDITOR LAYOUT --- */
.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 900px) {
    .editor-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}

.editor-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 30px;
}

.editor-sidebar-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 900px) {
    .editor-sidebar-col {
        width: 320px;
        flex-shrink: 0;
    }
}

.editor-panel {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
}

.editor-panel h4 {
    margin-bottom: 20px;
    color: var(--blue);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 12px;
}

.editor-title-input {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    outline: none;
    font-family: inherit;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.editor-title-input::placeholder {
    color: rgba(255,255,255,0.45);
}

.sidebar-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-btn-group button {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.9rem;
}

/* Admin Form / Editor */
.editor-group {
    margin-bottom: 24px;
}

.editor-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text2);
    margin-bottom: 8px;
    font-weight: 600;
}

.editor-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
}

.editor-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(41, 151, 255, 0.2);
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.ql-toolbar.ql-snow .ql-stroke {
    stroke: #ccc;
}
.ql-toolbar.ql-snow .ql-fill {
    fill: #ccc;
}
.ql-toolbar.ql-snow .ql-picker {
    color: #ccc;
}
.ql-container.ql-snow {
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: var(--surface2);
    font-family: inherit;
    font-size: 1.1rem;
    min-height: 400px;
    color: #fff;
}

/* Fix Quill Placeholder Visibility */
.ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.45) !important;
    font-style: normal !important;
}

/* Admin Post List */
.admin-posts-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-posts-table th, .admin-posts-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.admin-posts-table th {
    color: var(--text2);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-posts-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.admin-action-btn {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 12px;
}

.admin-action-btn.delete {
    color: #ef4444;
}

/* --- AUTH PAGE --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text2);
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.auth-toggle {
    text-align: center;
    margin-top: 24px;
    color: var(--text2);
    font-size: 0.9rem;
}

.auth-toggle a {
    color: var(--blue);
    font-weight: 600;
    cursor: pointer;
}

/* ═══════════════════════════════════════════
   AI ASISTAN PANELİ
   ═══════════════════════════════════════════ */

/* AI Trigger Button */
.ai-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    color: #c4b5fd;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
}

.ai-trigger-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(59, 130, 246, 0.35));
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
    color: #ddd6fe;
}

.ai-trigger-btn .ai-icon {
    font-size: 1rem;
    animation: aiPulse 2.5s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

/* AI Panel (Collapsible) */
.ai-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.45s ease,
                opacity 0.3s ease;
    opacity: 0;
    margin-bottom: 20px;
}

.ai-panel.open {
    max-height: 900px;
    padding: 24px;
    opacity: 1;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #c4b5fd, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.ai-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: 0.2s;
}

.ai-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* AI Prompt Textarea */
.ai-prompt-area {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
    transition: 0.3s;
    margin-bottom: 4px;
    box-sizing: border-box;
}

.ai-prompt-area:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ai-prompt-area::placeholder {
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

/* AI Options Row */
.ai-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

@media (min-width: 700px) {
    .ai-options-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.ai-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-option-label {
    font-size: 0.75rem;
    color: rgba(196, 181, 253, 0.7);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    padding: 8px 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a78bfa' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.ai-select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
}

.ai-select option {
    background: #1a1a2e;
}

/* AI Generate Button */
.ai-generate-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}

.ai-generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #6d28d9, #1d4ed8);
    opacity: 0;
    transition: 0.3s;
}

.ai-generate-btn:hover::before { opacity: 1; }

.ai-generate-btn:hover {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.ai-generate-btn span { position: relative; z-index: 1; }

.ai-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* AI Loading State */
.ai-loading-state {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    color: rgba(196, 181, 253, 0.8);
    font-size: 0.9rem;
}

.ai-loading-state.visible {
    display: flex;
}

.ai-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* AI Success Toast */
.ai-success-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #86efac;
    font-size: 0.85rem;
    margin-top: 12px;
}

.ai-success-bar.visible {
    display: flex;
}

/* AI Error State */
.ai-error-bar {
    display: none;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 12px;
    line-height: 1.5;
}

.ai-error-bar.visible {
    display: flex;
}

/* API Key hint link */
.ai-key-hint {
    font-size: 0.78rem;
    color: rgba(196, 181, 253, 0.6);
    margin-top: 6px;
    display: block;
}

.ai-key-hint a {
    color: #a78bfa;
    text-decoration: underline;
}

/* Shimmer effect on generate */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.ai-generate-btn.loading {
    background: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed);
    background-size: 200% auto;
    animation: shimmer 1.5s linear infinite;
    pointer-events: none;
}
