@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --primary-color: #0ea5e9; /* Light blue / cyan */
    --primary-hover: #0284c7;
    --accent-color: #10b981; /* Green from TechLeez */
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.top-nav {
    background: #ffffff;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-decoration: none;
}

.top-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.top-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.top-nav a:hover {
    color: var(--primary-color);
}

/* Hero Section (Blue Gradient) */
.hero-gradient {
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
    color: white;
    text-align: center;
    padding: 4rem 5%;
}

.hero-gradient h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-gradient p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-bar-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow);
    outline: none;
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
    width: 100%;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 3rem;
}

/* Posts Grid */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-right: 10px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-hover);
}

.post-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    object-fit: cover;
}

.post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tag-badge {
    background: #1f2937;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Single Post Page */
.article-header {
    margin-bottom: 2rem;
}
.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.author-avatar {
    width: 32px;
    height: 32px;
    background: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #374151;
}
.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}
.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    border-left: 5px solid var(--accent-color);
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 0 6px 6px 0;
    font-size: 1.3rem;
}
.article-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.article-content li {
    margin-bottom: 0.5rem;
}

/* Prompt Box inside Article */
.prompt-box {
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}
.prompt-text {
    font-family: monospace;
    font-size: 1rem;
    color: #4338ca;
    margin-bottom: 1rem;
    word-break: break-word;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.sidebar-post {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    text-decoration: none;
    color: inherit;
}
.sidebar-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.sidebar-post img {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.sidebar-post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.sidebar-post-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

/* Share & Buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
}
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn:hover {
    background: var(--primary-hover);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-wa { background: #25D366; }
.btn-tg { background: #0088cc; }
.btn-x { background: #0f1419; }

/* Admin Dashboard Layout */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}
.admin-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
}
.admin-sidebar ul {
    list-style: none;
}
.admin-sidebar li a {
    display: block;
    padding: 0.75rem 2rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.admin-sidebar li a:hover, .admin-sidebar li a.active {
    background: #f3f4f6;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}
.admin-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-color);
}
.admin-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-main); }
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
textarea.form-control { min-height: 150px; resize: vertical; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Footer */
footer {
    background: #ffffff;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    margin-top: auto;
}
.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover { color: var(--primary-color); }

/* Comments */
.comment-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-main);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Dot Loader Animation */
.dot-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2rem;
    width: 100%;
}
.dot-loader span {
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot-loader span:nth-child(1) { animation-delay: -0.32s; }
.dot-loader span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Fade In Animation for smooth loading */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-card, .sidebar-post, #article-container, .comment-item, .admin-sidebar, .tab-content.active {
    animation: fadeInUp 0.5s ease-out forwards;
}

@media (max-width: 768px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .hero-gradient h1 { font-size: 2rem; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
    .admin-sidebar ul { display: flex; overflow-x: auto; }
    .admin-sidebar li a { padding: 0.5rem 1rem; border-left: none; }
    .admin-sidebar li a.active { border-bottom: 2px solid var(--primary-color); border-left: none; }
}

/* Push Notification Modal */
.push-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding-top: 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.push-modal-overlay.show {
    display: flex;
    opacity: 1;
}
.push-modal {
    background: white;
    width: 450px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 20px;
    animation: slideDown 0.4s ease forwards;
    transform: translateY(-20px);
}
@keyframes slideDown {
    to { transform: translateY(0); }
}
.push-modal-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.push-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px double var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}
.push-modal-text {
    flex: 1;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 5px;
}
.push-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}
.push-btn-later {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 8px 15px;
    cursor: pointer;
}
.push-btn-subscribe {
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 8px 25px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.push-btn-subscribe:hover {
    background: #0056b3;
}

/* New Post Notification Banner */
.notify-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 10001;
    padding: 12px 20px;
    animation: slideDown 0.5s ease forwards;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.notify-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.notify-bell-icon {
    font-size: 1.3rem;
    animation: bellShake 0.5s ease-in-out infinite alternate;
}
@keyframes bellShake {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(10deg); }
}
.notify-read-btn {
    background: white;
    color: #764ba2;
    padding: 6px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.notify-read-btn:hover {
    transform: scale(1.05);
}
.notify-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
}
.notify-close-btn:hover {
    opacity: 1;
}
