/* Reset & Variables */
:root {
    --sidebar-width: 240px;
    --header-height: 60px;
    --primary-color: #007bff;
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid #e5e5e5;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 12px;
    color: #86868b;
    margin-bottom: 10px;
    padding-left: 10px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #424245;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.sidebar-menu .icon {
    margin-right: 10px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.sidebar-menu .icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.sidebar-menu .count {
    margin-left: auto;
    background: #f5f5f7;
    color: #86868b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.header-desc {
    font-size: 12px;
    color: #86868b;
}

.header-search {
    flex: 0 0 300px;
}

.search-bar {
    width: 100%;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background: #f5f5f7;
    color: #86868b;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.search-bar .icon {
    margin-right: 5px;
}

/* Content */
.app-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 10px;
}

/* Featured Section */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.featured-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.featured-card:hover {
    transform: translateY(-4px);
}

.featured-card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.featured-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
}

.featured-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-excerpt {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card-meta {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rating {
    font-size: 12px;
    color: #f5a623;
    font-weight: 600;
}

/* Latest Apps Section */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.app-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

.app-card-link {
    display: flex;
    align-items: center;
}

.app-icon {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    margin-right: 15px;
    background: #eee;
}

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

.app-details {
    flex: 1;
    min-width: 0;
}

.app-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-desc {
    margin: 0 0 6px;
    font-size: 12px;
    color: #86868b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 11px;
    color: #86868b;
}

.app-rating {
    color: #f5a623;
}

.app-views {
    color: #a1a1a6;
    font-weight: 400;
    margin-left: 2px;
}

.app-date {
    margin-top: 4px;
    color: #a1a1a6;
    font-size: 10px;
}

.app-action {
    flex: 0 0 auto;
    margin-left: 10px;
}

.btn-get {
    background: #f0f0f5;
    color: var(--primary-color);
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
}

.btn-get:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Article / Post View */
.article {
    background: #ffffff;
    border-radius: 24px;
    padding: 60px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    max-width: 960px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 40px;
    text-align: center;
}

.article-title {
    font-size: 40px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
}

.article-content {
    font-size: 18px;
    line-height: 1.7;
    color: #333;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #1d1d1f;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

.article-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    display: block;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5em;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1.5em 0;
    padding: 0 20px;
    color: #555;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
    }
    
    .app-main {
        margin-left: 0;
    }

    .app-header {
        padding: 0 20px;
    }

    .app-content {
        padding: 20px;
    }

    .article {
        padding: 30px;
        border-radius: 16px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-content {
        font-size: 16px;
    }
}

/* Ghost Koenig Editor Styles */
.kg-width-wide {
    grid-column: wide-start/wide-end;
}

.kg-width-full {
    grid-column: full-start/full-end;
}

.kg-width-full img {
    width: 100%;
}

.kg-image-card img {
    width: 100%;
    height: auto;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
    width: 100vw;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

.kg-bookmark-card {
    width: 100%;
    background: #fff;
}

.kg-card + .kg-card {
    margin-top: 20px;
}
