/* Google Fonts CDN Imports */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@300;400;500;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --sanatan-primary: #FF6B1A;
    --sanatan-primary-rgb: 255, 107, 26;
    --sanatan-maroon: #7A0C0C;
    --sanatan-gold: #FFD700;
    --sanatan-bg-light: #F7F7F8;
    --sanatan-bg-dark: #0F1115;
    
    --bs-font-sans-serif: 'Poppins', 'Noto Sans Gujarati', system-ui, -apple-system, sans-serif;
}

/* Light / Dark Native Overrides via data-bs-theme */
[data-bs-theme="light"] {
    --body-bg: var(--sanatan-bg-light);
    --card-bg: #ffffff;
    --border-color: #e3e8ec;
    --text-color: #212529;
    --muted-color: #6c757d;
}

[data-bs-theme="dark"] {
    --body-bg: var(--sanatan-bg-dark);
    --card-bg: #161a22;
    --border-color: #2b303c;
    --text-color: #f8f9fa;
    --muted-color: #9ea7af;
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--body-bg) !important;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Customized Saffron Accent Primary Buttons & Badges */
.btn-primary {
    background: linear-gradient(135deg, var(--sanatan-primary) 0%, #ff8c42 100%) !important;
    border: none !important;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    color: #fff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 107, 26, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 26, 0.4);
    opacity: 0.95;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border-color: var(--sanatan-primary) !important;
    color: var(--sanatan-primary) !important;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--sanatan-primary) !important;
    color: #fff !important;
}

.text-primary {
    color: var(--sanatan-primary) !important;
}

.bg-primary {
    background-color: var(--sanatan-primary) !important;
}

/* Sidebar Custom Styling */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.sidebar-link i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    background-color: rgba(255, 107, 26, 0.1);
    color: var(--sanatan-primary) !important;
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-link.active {
    color: var(--sanatan-primary) !important;
    font-weight: 700;
}

/* Timeline Cards and Feed UI */
.post-card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.post-card:hover {
    border-color: rgba(255, 107, 26, 0.3) !important;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e9ecef;
}

@media (min-width: 576px) {
    .avatar-image {
        width: 48px;
        height: 48px;
    }
}

.avatar-large {
    width: 120px;
    height: 120px;
    border: 4px solid var(--card-bg);
}

.verified-badge {
    color: var(--sanatan-gold);
    font-size: 1rem;
}

.post-username {
    max-width: 90px;
    display: inline-block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: bottom;
}

@media (min-width: 400px) {
    .post-username {
        max-width: 130px;
    }
}

@media (min-width: 576px) {
    .post-username {
        max-width: 180px;
    }
}

/* Post Action Icons */
.post-action {
    color: var(--muted-color);
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    padding: 0.25rem 0.4rem;
    border-radius: 50px;
}

@media (min-width: 576px) {
    .post-action {
        gap: 0.4rem;
        padding: 0.35rem 0.65rem;
    }
}

.post-action:hover {
    color: var(--sanatan-primary);
    background-color: rgba(255, 107, 26, 0.1);
}

.post-action.liked {
    color: #dc3545;
}
.post-action.liked:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.post-action.bookmarked {
    color: var(--sanatan-gold);
}

/* Mobile Bottom Nav styling */
.mobile-nav-bar {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.mobile-nav-link {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 1.4rem;
}

.mobile-nav-link.active {
    color: var(--sanatan-primary);
}

/* Right Sidebar widgets */
.trending-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
}

.trending-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    text-decoration: none;
    display: block;
    color: var(--text-color);
    transition: opacity 0.2s;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    opacity: 0.85;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Skeleton Loading Shimmer Effect */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1d212b 25%, #2c3140 50%, #1d212b 75%);
    background-size: 200% 100%;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Custom Floating Compose Button for Mobile */
.btn-compose-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sanatan-primary) 0%, #ff8c42 100%);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 26, 0.4);
    z-index: 1030;
    text-decoration: none;
    font-size: 1.5rem;
    border: none;
}

/* Custom Profile Header Banner */
.profile-banner {
    height: 200px;
    background-color: var(--sanatan-maroon);
    background-size: cover;
    background-position: center;
}

.profile-avatar-overlap {
    margin-top: -60px;
    margin-left: 20px;
    z-index: 2;
    position: relative;
}

.profile-action-buttons {
    z-index: 3;
    position: relative;
}

/* Admin Dashboard layout tweaks */
.admin-sidebar {
    background-color: #0d0f14;
    color: #e9ecef;
}

.admin-sidebar .nav-link {
    color: #a0aec0;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 107, 26, 0.15);
}

/* 🎥 Custom HTML5 Video Player */
.custom-video-player {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}
.custom-video-player video {
    display: block;
    width: 100%;
    height: auto;
}
.custom-video-player .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}
.custom-video-player:hover .video-controls,
.custom-video-player.touch-active .video-controls {
    opacity: 1;
}
.custom-video-player .progress-container {
    flex-grow: 1;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}
.custom-video-player .progress-bar-fill {
    height: 100%;
    background-color: var(--sanatan-primary);
    border-radius: 3px;
    width: 0%;
}
.custom-video-player .video-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: #ffffff;
    opacity: 0.85;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}
.custom-video-player:hover .video-overlay-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}
.custom-video-player.playing .video-overlay-btn {
    opacity: 0;
    pointer-events: none;
}
.custom-video-player .play-pause-btn,
.custom-video-player .mute-btn,
.custom-video-player .fullscreen-btn {
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.custom-video-player .play-pause-btn:hover,
.custom-video-player .mute-btn:hover,
.custom-video-player .fullscreen-btn:hover {
    transform: scale(1.1);
    color: var(--sanatan-primary);
}
.custom-video-player .time-display {
    font-size: 0.8rem;
    color: #e2e8f0;
    font-family: monospace;
    user-select: none;
}
