/* ============================================
   IMPORTS & THEME
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400;1,600&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
    --font-serif: 'Playfair Display', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --bg-gray-200: #e5e7eb;
    --text-gray-900: #111827;
    --text-gray-700: #374151;
    --text-gray-600: #4b5563;
    --text-gray-500: #6b7280;
    --text-gray-400: #9ca3af;
    --border-gray-200: #e5e7eb;
    --border-gray-300: #d1d5db;
    --border-gray-100: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-xl: 0.75rem;
    --radius-full: 9999px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-white);
    color: var(--text-gray-900);
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
#app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-gray-200);
}

.header-inner {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.125rem;
}

.logo-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    display: none;
}

@media (min-width: 640px) {
    .logo-text {
        display: inline;
    }
}

.search-wrapper {
    flex: 1;
    max-width: 36rem;
}

.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray-400);
    font-size: 0.875rem;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-gray-300);
    border-radius: var(--radius-full);
    background: var(--bg-gray-50);
    font-size: 0.875rem;
    line-height: 1.25rem;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    background: var(--bg-white);
    border-color: #000;
    box-shadow: 0 0 0 2px #000;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.user-actions .btn-new-post {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: #000;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.user-actions .btn-new-post:hover {
    background: #1f2937;
}

.user-actions .btn-analytics {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-actions .btn-analytics:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.user-actions .user-badge {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--bg-gray-50);
    border: 1px solid var(--border-gray-200);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray-700);
}

@media (min-width: 640px) {
    .user-actions .user-badge {
        display: flex;
    }
}

.user-actions .btn-signout {
    padding: 0.5rem;
    color: var(--text-gray-400);
    background: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    font-size: 1.25rem;
}

.user-actions .btn-signout:hover {
    color: #000;
    background: var(--bg-gray-100);
}

.user-actions .btn-signin {
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-gray-300);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
}

.user-actions .btn-signin:hover {
    background: var(--bg-gray-50);
}

/* ============================================
   MAIN
   ============================================ */
#app-main {
    max-width: 64rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

#feedControls {
    margin-bottom: 2rem;
}

.tab-group {
    display: inline-flex;
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-full);
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-gray-500);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    color: #000;
    background: var(--bg-gray-100);
}

.tab-btn.active {
    background: #000;
    color: #fff;
}

.search-heading {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-gray-900);
    margin-bottom: 1.5rem;
}

/* ============================================
   POST LIST
   ============================================ */
#postList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: var(--text-gray-400);
}

.post-card-inner {
    display: flex;
}

.post-votes {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-gray-50);
    border-right: 1px solid var(--border-gray-100);
    width: 3rem;
    flex-shrink: 0;
    gap: 0.125rem;
}

@media (min-width: 640px) {
    .post-votes {
        display: flex;
    }
}

.post-votes .vote-btn {
    padding: 0.25rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-gray-400);
    transition: color 0.2s, background 0.2s;
    font-size: 1.25rem;
}

.post-votes .vote-btn:hover {
    background: var(--bg-gray-200);
}

.post-votes .vote-btn.voted-up {
    color: #000;
}

.post-votes .vote-btn.voted-down {
    color: #000;
}

.post-votes .vote-score {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-gray-900);
}

.post-body {
    padding: 1rem;
    flex: 1;
}

@media (min-width: 640px) {
    .post-body {
        padding: 1.25rem;
    }
}

.post-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.post-excerpt {
    color: var(--text-gray-600);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-gray-500);
}

.post-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.post-actions .action-btn:hover {
    background: var(--bg-gray-100);
}

.post-actions .action-btn i {
    font-size: 0.875rem;
}

.post-actions .action-btn .label-sm {
    display: none;
}

@media (min-width: 640px) {
    .post-actions .action-btn .label-sm {
        display: inline;
    }
}

.post-actions .action-btn.delete-btn {
    color: #dc2626;
    margin-left: auto;
}

.post-actions .action-btn.delete-btn:hover {
    background: #fef2f2;
}

.mobile-votes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-gray-50);
    border-radius: var(--radius-full);
    padding: 0.125rem 0.5rem;
}

.mobile-votes .vote-btn {
    padding: 0.25rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-gray-400);
    font-size: 1rem;
}

.mobile-votes .vote-btn.voted-up {
    color: #000;
}

.mobile-votes .vote-btn.voted-down {
    color: #000;
}

.mobile-votes .vote-score {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-gray-900);
}

@media (min-width: 640px) {
    .mobile-votes {
        display: none;
    }
}

/* ============================================
   POST DETAIL
   ============================================ */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-gray-500);
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #000;
}

.back-btn i {
    transition: transform 0.2s;
}

.back-btn:hover i {
    transform: translateX(-4px);
}

.detail-article {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.detail-inner {
    display: flex;
}

.detail-votes {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-gray-50);
    border-right: 1px solid var(--border-gray-100);
    width: 4rem;
    flex-shrink: 0;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .detail-votes {
        display: flex;
    }
}

.detail-votes .vote-btn {
    padding: 0.25rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-gray-400);
    transition: color 0.2s, background 0.2s;
    font-size: 1.5rem;
}

.detail-votes .vote-btn:hover {
    background: var(--bg-gray-200);
}

.detail-votes .vote-btn.voted-up {
    color: #000;
}

.detail-votes .vote-btn.voted-down {
    color: #000;
}

.detail-votes .vote-score {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-gray-900);
}

.detail-content {
    padding: 1rem;
    flex: 1;
}

@media (min-width: 640px) {
    .detail-content {
        padding: 1.5rem;
    }
}

.detail-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-gray-900);
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .detail-title {
        font-size: 1.875rem;
    }
}

.detail-body {
    color: var(--text-gray-700);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
}

.detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.detail-body h2, .detail-body h3 {
    margin: 1.5rem 0 0.5rem 0;
    font-family: var(--font-serif);
}

.detail-body ul, .detail-body ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem 0;
}

.detail-body blockquote {
    border-left: 4px solid var(--border-gray-200);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-gray-600);
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-gray-500);
    flex-wrap: wrap;
}

.detail-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-actions .action-btn:hover {
    background: var(--bg-gray-100);
}

.detail-actions .action-btn i {
    font-size: 1rem;
}

.detail-actions .action-btn.delete-btn {
    color: #dc2626;
    margin-left: auto;
}

.detail-actions .action-btn.delete-btn:hover {
    background: #fef2f2;
}

.detail-mobile-votes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .detail-mobile-votes {
        display: none;
    }
}

.detail-mobile-votes .vote-btn {
    padding: 0.25rem;
    border: none;
    background: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-gray-400);
    font-size: 1.25rem;
}

.detail-mobile-votes .vote-btn.voted-up {
    color: #000;
}

.detail-mobile-votes .vote-btn.voted-down {
    color: #000;
}

.detail-mobile-votes .vote-score {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-gray-900);
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-gray-100);
}

.comments-section h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-gray-900);
    margin-bottom: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    background: var(--bg-gray-50);
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-sans);
}

.comment-form textarea:focus {
    border-color: #000;
    box-shadow: 0 0 0 2px #000;
    background: var(--bg-white);
}

.comment-form .comment-submit {
    align-self: flex-end;
    padding: 0.5rem 1.5rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .comment-submit:hover {
    background: #1f2937;
}

.comment-form .comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-gray-100);
}

.comment:last-child {
    border-bottom: none;
}

.comment .comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-gray-900);
}

.comment .comment-time {
    font-size: 0.75rem;
    color: var(--text-gray-400);
    margin-left: 0.5rem;
}

.comment .comment-body {
    margin-top: 0.25rem;
    color: var(--text-gray-700);
    font-size: 0.95rem;
    line-height: 1.5;
}

.comment .comment-delete {
    float: right;
    background: none;
    border: none;
    color: var(--text-gray-400);
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.comment .comment-delete:hover {
    color: #dc2626;
}

.no-comments {
    color: var(--text-gray-500);
    font-size: 0.875rem;
    padding: 1rem 0;
}

/* ============================================
   SHARE MODAL
   ============================================ */
.share-modal .share-url-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.share-modal .share-url-container input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: var(--bg-gray-50);
    cursor: text;
}

.share-modal .share-url-container button {
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.share-modal .share-url-container button:hover {
    background: #1f2937;
}

.share-modal .share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.share-modal .share-buttons button {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    transition: opacity 0.2s;
}

.share-modal .share-buttons button:hover {
    opacity: 0.8;
}

.share-modal .share-buttons .btn-twitter { background: #1DA1F2; }
.share-modal .share-buttons .btn-facebook { background: #1877F2; }
.share-modal .share-buttons .btn-linkedin { background: #0A66C2; }
.share-modal .share-buttons .btn-whatsapp { background: #25D366; }
.share-modal .share-buttons .btn-email { background: #6B7280; }

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 42rem;
    overflow: hidden;
    animation: zoomIn 0.2s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.login-modal {
    max-width: 24rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-gray-100);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 1;
}

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-gray-900);
}

.modal-close {
    padding: 0.5rem;
    color: var(--text-gray-400);
    background: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    font-size: 1.25rem;
}

.modal-close:hover {
    color: #000;
    background: var(--bg-gray-100);
}

.modal-body {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    background: var(--bg-gray-50);
    font-size: 1rem;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-sans);
}

.modal-body input:focus,
.modal-body textarea:focus {
    background: var(--bg-white);
    border-color: #000;
    box-shadow: 0 0 0 2px #000;
}

.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-gray-400);
}

.modal-body input {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.125rem;
}

.modal-body textarea {
    resize: vertical;
    font-size: 1rem;
    min-height: 150px;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-gray-50);
    position: sticky;
    bottom: 0;
}

.modal-footer .btn-cancel {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray-600);
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.modal-footer .btn-cancel:hover {
    color: #000;
    background: var(--bg-gray-200);
}

.modal-footer .btn-publish {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #000;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-footer .btn-publish:hover {
    background: #1f2937;
}

.modal-footer .btn-publish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Form */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray-700);
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    background: var(--bg-gray-50);
    font-size: 1rem;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    background: var(--bg-white);
    border-color: #000;
    box-shadow: 0 0 0 2px #000;
}

.btn-join {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-xl);
    background: #000;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.btn-join:hover {
    background: #1f2937;
}

/* ============================================
   ANALYTICS DASHBOARD STYLES
   ============================================ */
.analytics-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .analytics-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-gray-50) 0%, var(--bg-white) 100%);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), #8b5cf6);
}

.stat-card.views-card::before {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.stat-card.money-card::before {
    background: linear-gradient(90deg, #10b981, #84cc16);
}

.stat-card.posts-card::before {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.stat-card.rate-card::before {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.25rem;
}

.stat-card.views-card .stat-icon {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #3b82f6;
}

.stat-card.money-card .stat-icon {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #10b981;
}

.stat-card.posts-card .stat-icon {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #8b5cf6;
}

.stat-card.rate-card .stat-icon {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #f59e0b;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-gray-900);
    line-height: 1.2;
}

.stat-subvalue {
    font-size: 0.75rem;
    color: var(--text-gray-400);
    margin-top: 0.25rem;
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .analytics-charts {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-container {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    position: relative;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chart-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chart-icon.money-chart {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #10b981;
}

.chart-icon.views-chart {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #3b82f6;
}

.chart-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-gray-900);
}

.chart-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
}

@media (min-width: 640px) {
    .chart-wrapper {
        height: 250px;
    }
}

.analytics-posts {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.posts-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-gray-100);
    background: var(--bg-gray-50);
}

.posts-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #8b5cf6;
    font-size: 1rem;
}

.posts-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-gray-900);
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-gray-100);
    background: var(--bg-gray-50);
}

.posts-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-gray-100);
}

.posts-table tr:last-child td {
    border-bottom: none;
}

.posts-table tr:hover {
    background: var(--bg-gray-50);
}

.post-title-cell {
    font-weight: 500;
    color: var(--text-gray-900);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-gray-500);
}

.post-stat i {
    font-size: 0.75rem;
}

.post-stat.views {
    color: #3b82f6;
}

.post-stat.earnings {
    color: #10b981;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-gray-400);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-gray-400);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .header-inner {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    .logo-icon {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
    }
    .search-box input {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem 0.375rem 2rem;
    }
    .search-box .search-icon {
        font-size: 0.75rem;
        left: 0.5rem;
    }
    .user-actions .btn-new-post {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    .post-title {
        font-size: 1rem;
    }
    .post-body {
        padding: 0.75rem;
    }
    .detail-title {
        font-size: 1.25rem;
    }
    .modal-content {
        max-width: 100%;
        margin: 0 0.5rem;
    }
    
    .analytics-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .posts-table th,
    .posts-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .post-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}