/* ============================================
   VoxTalkBox - Main Stylesheet
   Overrides and extends Bootstrap 5
   ============================================ */

:root {
    --omt-primary: #6366f1;
    --omt-primary-dark: #4f46e5;
    --omt-secondary: #8b5cf6;
    --omt-bg: #f8fafc;
    --omt-card-bg: #ffffff;
    --omt-text: #1e293b;
    --omt-text-muted: #64748b;
    --omt-border: #e2e8f0;
    --omt-radius: 12px;
    --omt-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --omt-shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
}

/* General */
body {
    background-color: var(--omt-bg);
    color: var(--omt-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { color: var(--omt-primary); text-decoration: none; }
a:hover { color: var(--omt-primary-dark); }

/* Navbar */
.navbar-omt {
    background: var(--omt-card-bg);
    border-bottom: 1px solid var(--omt-border);
    box-shadow: var(--omt-shadow);
    padding: 0.6rem 1rem;
}
.navbar-omt .navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--omt-primary);
    letter-spacing: -0.5px;
}
.navbar-omt .nav-link {
    color: var(--omt-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.navbar-omt .nav-link:hover,
.navbar-omt .nav-link.active {
    color: var(--omt-primary);
}

/* Category pills in navbar */
.cat-pill {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s;
}
.cat-pill:hover { background: var(--omt-primary); color: #fff !important; }

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    padding: 3rem 0;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2rem;
}
.hero-section h1 { font-weight: 800; font-size: 2.2rem; }
.hero-section p { font-size: 1.1rem; opacity: 0.9; }
.hero-section .search-box {
    background: #fff;
    border-radius: 30px;
    padding: 0.5rem 0.5rem 0.5rem 1.2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero-section .search-box input { border: none; outline: none; }
.hero-section .search-box button { border-radius: 25px; }

/* Cards */
.card-omt {
    background: var(--omt-card-bg);
    border: 1px solid var(--omt-border);
    border-radius: var(--omt-radius);
    box-shadow: var(--omt-shadow);
    transition: box-shadow 0.3s, transform 0.2s;
    overflow: hidden;
}
.card-omt:hover {
    box-shadow: var(--omt-shadow-hover);
    transform: translateY(-2px);
}
.card-omt .card-body { padding: 1.2rem; }
.card-omt .card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--omt-text);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-omt .card-text {
    color: var(--omt-text-muted);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post images in cards */
.post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

/* Category section */
.category-section { margin-bottom: 2.5rem; }
.category-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.category-section h2 i { color: var(--omt-primary); }
.category-section .view-all {
    font-size: 0.85rem;
    margin-left: auto;
}

/* Avatar */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--omt-border);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 48px; height: 48px; }

/* Post detail */
.post-detail-title {
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--omt-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--omt-border);
}
.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--omt-text);
}
.post-content p { margin-bottom: 1rem; }
.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}
.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}
.post-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.post-gallery img:hover { transform: scale(1.03); }

/* Comments */
.comment-section { margin-top: 2.5rem; }
.comment-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--omt-border);
}
.comment-item:last-child { border-bottom: none; }
.comment-body {
    flex: 1;
}
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--omt-text);
}
.comment-date {
    font-size: 0.75rem;
    color: var(--omt-text-muted);
}
.comment-text {
    font-size: 0.9rem;
    color: var(--omt-text);
    margin-top: 0.25rem;
    line-height: 1.5;
}
.comment-login-prompt {
    text-align: center;
    padding: 1.5rem;
    background: var(--omt-bg);
    border-radius: var(--omt-radius);
    border: 1px dashed var(--omt-border);
}
.comment-login-prompt a { font-weight: 600; }

/* Forms */
.form-card {
    background: var(--omt-card-bg);
    border: 1px solid var(--omt-border);
    border-radius: var(--omt-radius);
    padding: 2rem;
    box-shadow: var(--omt-shadow);
}
.form-card h2 { font-weight: 700; margin-bottom: 1.5rem; }
.form-label { font-weight: 600; font-size: 0.9rem; }
.btn-omt-primary {
    background: var(--omt-primary);
    color: #fff;
    border: none;
    padding: 0.55rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-omt-primary:hover { background: var(--omt-primary-dark); color: #fff; }

/* Image upload area */
.upload-area {
    border: 2px dashed var(--omt-border);
    border-radius: var(--omt-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-area:hover { border-color: var(--omt-primary); background: rgba(99,102,241,0.04); }
.upload-area.dragover { border-color: var(--omt-primary); background: rgba(99,102,241,0.1); }
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}
.upload-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--omt-border);
}
.upload-preview .img-wrapper {
    position: relative;
    display: inline-block;
}
.upload-preview .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin sidebar */
.admin-sidebar {
    background: #1e293b;
    min-height: 100vh;
    padding: 1.5rem 0;
}
.admin-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    margin: 2px 0.75rem;
    font-size: 0.9rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--omt-primary);
    color: #fff;
}
.admin-sidebar .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid #334155;
    margin-bottom: 0.5rem;
}
.admin-content { padding: 1.5rem 2rem; }

/* Stat cards */
.stat-card {
    background: var(--omt-card-bg);
    border-radius: var(--omt-radius);
    padding: 1.5rem;
    box-shadow: var(--omt-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--omt-text-muted); }

/* Footer */
.footer-omt {
    background: var(--omt-card-bg);
    border-top: 1px solid var(--omt-border);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--omt-text-muted);
    font-size: 0.85rem;
}

/* Badges */
.badge-category {
    background: rgba(99,102,241,0.1);
    color: var(--omt-primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 1.5rem; }
    .post-detail-title { font-size: 1.3rem; }
    .admin-sidebar { min-height: auto; }
}

/* Loading spinner */
.spinner-omt {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--omt-border);
    border-top-color: var(--omt-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alert */
.alert-omt {
    border-radius: var(--omt-radius);
    border: none;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* SEO Keyword tag input */
.keyword-input-wrapper {
    border: 1px solid var(--omt-border);
    border-radius: 8px;
    padding: 6px 8px;
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    cursor: text;
    transition: border-color 0.2s;
}
.keyword-input-wrapper:focus-within { border-color: var(--omt-primary); }
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99,102,241,0.1);
    color: var(--omt-primary);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 500;
}
.keyword-tag i {
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.keyword-tag i:hover { opacity: 1; }
.keyword-input {
    border: none !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 120px;
    padding: 4px 0 !important;
}
