:root {
    --bg-dark: #0A0E1A;
    --bg-panel: #131A2B;
    --bg-panel-alt: #1B2438;
    --electric-blue: #00D4FF;
    --electric-purple: #8B5CF6;
    --electric-pink: #FF2E9F;
    --text-light: #E8ECF4;
    --text-muted: #8B96AD;
    --border-glow: rgba(0, 212, 255, 0.25);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    overflow-x: hidden;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 16px 24px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-glow);
}

.logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--electric-blue), var(--electric-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    white-space: nowrap;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 15px;
}

nav a:hover { color: var(--electric-blue); }

.flash-messages { max-width: 900px; margin: 16px auto 0; padding: 0 20px; }
.flash { background: var(--bg-panel-alt); color: var(--electric-blue); border: 1px solid var(--border-glow); padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; }

.hero, .page-hero {
    text-align: center;
    padding: 60px 20px;
    background: radial-gradient(circle at top, rgba(139,92,246,0.25), transparent 60%), linear-gradient(135deg, #0A0E1A 0%, #131A2B 100%);
    border-bottom: 1px solid var(--border-glow);
}

.hero h1, .page-hero h1 {
    font-size: clamp(28px, 5vw, 42px);
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--electric-blue), var(--electric-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.hero p, .page-hero p {
    font-size: clamp(15px, 2.5vw, 18px);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.latest-posts { max-width: 900px; margin: 60px auto; padding: 0 20px; }
.latest-posts h2 { margin-bottom: 20px; }

.post-card {
    background: var(--bg-panel);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border-glow);
}
.post-card h3 a { color: var(--text-light); text-decoration: none; }
.post-card h3 a:hover { color: var(--electric-blue); }

.widget-section { width: 100%; margin: 0; padding: 0; }
.widget-placeholder {
    max-width: 900px;
    margin: 20px auto;
    background: var(--bg-panel);
    border: 2px dashed var(--border-glow);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.widget-card {
    background: #FFFFFF;
    width: 100%;
    overflow: hidden;
    border-top: 1px solid var(--border-glow);
    border-bottom: 1px solid var(--border-glow);
}

.widget-frame {
    width: 100%;
    border: none;
    display: block;
}

.content-block { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.content-block h2 { margin-bottom: 20px; font-size: clamp(20px, 4vw, 26px); }

.tips-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.tips-see-all { color: var(--electric-blue); text-decoration: none; font-size: 14px; font-weight: 600; }
.tips-see-all:hover { color: var(--electric-pink); }

.tip-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-glow);
    background: var(--bg-panel);
}
.tip-carousel-track {
    display: flex;
    transition: transform 0.6s ease;
}
.tip-slide {
    min-width: 100%;
    padding: 30px 24px;
    box-sizing: border-box;
}
.tip-slide h3 {
    color: var(--electric-blue);
    margin-bottom: 12px;
    font-size: 19px;
}
.tip-slide p { color: var(--text-light); line-height: 1.6; }

.tip-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-bottom: 16px;
}
.tip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-glow);
    transition: background 0.3s;
}
.tip-dot.active { background: var(--electric-blue); }

.tips-grid-section { max-width: 1100px; margin: 40px auto; padding: 0 20px; }
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.tip-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 22px;
}
.tip-card h3 { color: var(--electric-blue); margin-bottom: 10px; font-size: 17px; }
.tip-card p { color: var(--text-muted); line-height: 1.6; font-size: 14px; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-light);
    transition: border-color 0.2s, transform 0.2s;
}
.category-card:hover {
    border-color: var(--electric-blue);
    transform: translateY(-2px);
}
.category-icon { font-size: 26px; flex-shrink: 0; }
.category-name { font-weight: 600; font-size: 15px; }

.blog-list { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.category-tag {
    display: inline-block;
    background: rgba(139,92,246,0.2);
    color: var(--electric-purple);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 8px 0;
}

.post-detail { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.post-detail h1 { font-size: clamp(24px, 5vw, 32px); margin-bottom: 8px; }
.post-body { margin-top: 20px; line-height: 1.7; }

.related-posts { max-width: 800px; margin: 40px auto; padding: 20px; border-top: 1px solid var(--border-glow); }
.related-link { display: block; margin-top: 8px; color: var(--electric-blue); text-decoration: none; }

.login-form, .post-form {
    max-width: 500px;
    margin: 60px auto;
    padding: 24px;
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-glow);
}
.login-form label, .post-form label { display: block; margin-top: 16px; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--text-muted); }
.login-form input, .post-form input, .post-form select, .post-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-panel-alt);
    color: var(--text-light);
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-label input { width: auto; }

button, .btn-primary, .btn-secondary {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}
button, .btn-primary {
    background: linear-gradient(90deg, var(--electric-blue), var(--electric-purple));
    color: #0A0E1A;
}
.btn-secondary {
    background: var(--bg-panel-alt);
    color: var(--text-light);
    margin-left: 8px;
    border: 1px solid var(--border-glow);
}

.admin-dashboard { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-glow); }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-glow); }
.admin-table th { background: var(--bg-panel-alt); font-size: 13px; text-transform: uppercase; color: var(--text-muted); }
.admin-table a { color: var(--electric-blue); }

.site-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 14px; }
.admin-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-panel-alt);
    margin-top: 8px;
    text-decoration: none;
}
.admin-dot:hover { background: var(--electric-blue); }

@media (max-width: 480px) {
    .site-header { padding: 14px 16px; }
    nav { gap: 6px 16px; }
    .hero, .page-hero { padding: 40px 16px; }
    .content-block, .tips-grid-section, .latest-posts, .admin-dashboard { padding: 0 16px; }
    .tip-slide { padding: 22px 18px; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .admin-table th, .admin-table td { padding: 10px 12px; font-size: 13px; }
}
.post-card {
    transition: border-color 0.2s, transform 0.2s;
}
.post-card:hover {
    border-color: var(--electric-blue);
    transform: translateY(-2px);
}
.post-card h3 { margin: 8px 0; font-size: 19px; }
.post-card p { color: var(--text-muted); margin-bottom: 10px; }
.whatsapp-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 52px;
    height: 52px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999;
}

.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    background: linear-gradient(90deg, var(--electric-blue), var(--electric-purple));
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999;
}

.chat-widget {
    position: fixed;
    bottom: 82px;
    right: 20px;
    width: 300px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    overflow: hidden;
    z-index: 998;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chat-widget.hidden { display: none; }

.chat-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-panel-alt);
    font-weight: 600;
}
.chat-widget-header button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

#chat-form-area {
    padding: 16px;
}
#chat-form-area input, #chat-form-area textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-light);
    font-size: 13px;
}

@media (max-width: 480px) {
    .chat-widget { width: calc(100vw - 32px); right: 16px; }
    .whatsapp-fab, .chat-fab { width: 46px; height: 46px; }
}