@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #f3f4f6;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: #0f172a;
    --text-light: #ffffff;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    --text-gray: #475569;
    --border-color: #cbd5e1;
    --orange-primary: #f97316;
    --orange-hover: #ea580c;
    --blue-accent: #3b82f6;
    --success-green: #10b981;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition-speed: 0.2s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-one {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
}

.logo-cms {
    color: var(--orange-primary);
    border-bottom: 2px solid var(--orange-primary);
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
}

.collapse-btn:hover {
    opacity: 1;
}

/* Profile Section */
.profile-section {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.1);
}

.news-portal-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.news-portal-logo span {
    color: var(--orange-primary);
}

.avatar-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.profile-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* User Switcher */
.user-switch-select {
    width: 90%;
    margin: 10px auto;
    background-color: #334155;
    color: white;
    border: 1px solid #475569;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    flex-grow: 1;
}

.menu-item {
    margin: 2px 0;
}

.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.menu-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-light);
}

.menu-link.active {
    background-color: var(--bg-sidebar-active);
    color: var(--text-light);
    border-left: 4px solid var(--orange-primary);
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.submenu {
    list-style: none;
    padding-left: 30px;
    background-color: rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu.open {
    max-height: 400px;
}

.submenu-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition-speed);
}

.submenu-link:hover {
    color: var(--text-light);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header bar */
.top-header {
    background-color: #ffffff;
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
}

.breadcrumb span {
    color: #9ca3af;
    margin: 0 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timer-badge {
    font-size: 13px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.autosave-badge {
    font-size: 12px;
    background-color: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border-color);
}

.btn-ask-ai {
    background-color: var(--orange-primary);
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
    transition: background-color var(--transition-speed);
}

.btn-ask-ai:hover {
    background-color: var(--orange-hover);
}

.btn-settings {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.btn-settings:hover {
    background-color: #f1f5f9;
}

/* Tab Panels */
.tab-panel {
    display: none;
    height: calc(100% - 60px);
    overflow-y: auto;
    padding: 20px;
    background-color: #f8fafc;
}

.tab-panel.active {
    display: block;
}

/* Page Grid Layout */
.page-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Cards & Lists */
.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

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

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-gray);
}

.input-count-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-count-limit {
    font-size: 11px;
    color: #94a3b8;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    color: var(--text-dark);
    background-color: #ffffff;
    transition: border-color var(--transition-speed);
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--blue-accent);
}

/* Headline Styling Tools */
.headline-style-tools {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.style-tool-btn {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.style-tool-btn.active {
    background-color: var(--orange-primary);
    color: white;
    border-color: var(--orange-primary);
}

/* Template Type Radio Buttons */
.template-type-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: var(--orange-primary);
    width: 16px;
    height: 16px;
}

/* Rich Text Editor Container */
.editor-container {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.editor-toolbar {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.toolbar-btn:hover {
    background-color: #e2e8f0;
}

.toolbar-btn.active {
    background-color: #cbd5e1;
}

.toolbar-separator {
    width: 1px;
    background-color: var(--border-color);
    margin: 4px 6px;
}

.editor-body {
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    background-color: #ffffff;
}

/* Blockquote & Quote Formatting */
blockquote {
    border-left: 4px solid var(--orange-primary);
    background-color: #fdf6e2;
    padding: 12px 16px;
    margin: 12px 0;
    font-style: italic;
    color: #475569;
}

/* Author Box Dashboard */
.author-box-card {
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-box-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.author-box-info p {
    font-size: 11px;
    color: var(--text-gray);
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #fafafa;
    transition: background-color var(--transition-speed);
}

.image-upload-area:hover {
    background-color: #f1f5f9;
}

.upload-icon {
    font-size: 28px;
    color: var(--orange-primary);
    margin-bottom: 8px;
}

.upload-text {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
}

.preview-thumbnail {
    max-width: 100%;
    max-height: 150px;
    object-fit: cover;
    margin-top: 10px;
    border-radius: 4px;
    display: none;
}

/* Post list table */
.posts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.posts-table th, .posts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.posts-table th {
    background-color: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-gray);
}

.posts-table td {
    font-size: 13px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-publish {
    background-color: #d1fae5;
    color: #065f46;
}

.status-draft {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-outline {
    background: none;
    border: 1px solid #cbd5e1;
    color: var(--text-gray);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

.btn-dark {
    background-color: #1e293b;
    color: #ffffff;
    border: none;
}

.btn-dark:hover {
    background-color: #0f172a;
}

.btn-primary {
    background-color: var(--blue-accent);
    color: #ffffff;
    border: none;
}

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

.btn-orange {
    background-color: var(--orange-primary);
    color: #ffffff;
    border: none;
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
}

.btn-orange:hover {
    background-color: var(--orange-hover);
}

/* Dynamic Tags list editor */
.list-editor-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-pill {
    background-color: #e2e8f0;
    color: var(--text-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-pill button {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-weight: bold;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-gray);
}

/* Actions list Sparkles AI */
.ai-generate-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.btn-generate-ai {
    background-color: var(--orange-primary);
    color: var(--text-light);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-generate-ai:hover {
    background-color: var(--orange-hover);
}

/* Multi-select styling */
.multi-select-container {
    position: relative;
}

.multi-select-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-option {
    padding: 8px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.multi-select-option:hover {
    background-color: #f1f5f9;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 20000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: var(--success-green);
}

.toast.error {
    background-color: #ef4444;
}

@media (max-width: 1024px) {
    .page-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10005;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .autosave-badge, 
    .timer-badge {
        display: none !important;
    }
    
    .top-header {
        padding: 0 12px;
    }
    
    .breadcrumb {
        font-size: 11px;
    }
    
    .form-grid-3, 
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tab-panel {
        padding: 12px;
        padding-bottom: 80px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    /* Responsive Dashboard styling */
    .card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title div {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .card-title input#dashboard-search {
        flex-grow: 1;
        width: auto !important;
    }
    
    /* Hide Author & Date on mobile for clean posts table */
    .hide-mobile {
        display: none !important;
    }
    
    .posts-table th, 
    .posts-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .posts-table td strong {
        font-weight: 500;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.4;
    }
    
    .status-badge {
        padding: 2px 6px;
        font-size: 10px;
    }
}

