/**
 * Najibul PWA - Enhanced YouTube Style Smart Bell System
 * Version: 28.0.0 - WORKING DESIGN + ENHANCED COLORS
 * Features: All options working, enhanced colors, fully responsive
 * FIXED: All functionality working with improved colors
 */

/* 🎯 BASE STYLES - YouTube Inspired */
.najibul-pwa-advanced-bell {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 20px 0;
    max-width: 100%;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* 🎯 SINGLE LINE CONTAINER - YouTube Style */
.advanced-bell-single-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 16px 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.advanced-bell-single-line::-webkit-scrollbar {
    display: none;
}

/* 🎯 REACTION BUTTONS - Enhanced Colors */
.advanced-reaction-wrapper {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.advanced-bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: #606060;
    height: 36px;
    min-width: 80px;
    position: relative;
    box-sizing: border-box;
}

.advanced-bell-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.advanced-bell-btn.active {
    color: #065fd4;
}

.advanced-bell-btn.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: #065fd4;
    border-radius: 18px;
    z-index: -1;
    opacity: 0.1;
}

/* Like Button - Enhanced Green */
.like-btn.active {
    color: #10b981;
}

.like-btn.active::before {
    background: #10b981;
}

/* Dislike Button - Enhanced Red */
.dislike-btn.active {
    color: #ef4444;
}

.dislike-btn.active::before {
    background: #ef4444;
}

.advanced-bell-emoji {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.advanced-bell-btn:hover .advanced-bell-emoji {
    transform: scale(1.1);
}

.advanced-bell-btn.active .advanced-bell-emoji {
    filter: none;
}

.advanced-bell-count {
    font-weight: 500;
    min-width: 20px;
    text-align: center;
    font-size: 13px;
}

/* 🎯 COUNT DISPLAY - Below Each Button */
.advanced-bell-count-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.advanced-bell-count {
    font-weight: 700;
    font-size: 14px;
    color: #2d3748;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    padding: 6px 12px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.advanced-bell-count::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.advanced-bell-count:hover::before {
    left: 100%;
}

.advanced-bell-count:hover {
    transform: translateY(-2px);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.advanced-bell-count.counting {
    animation: countBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

@keyframes countBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.count-label {
    font-size: 10px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.advanced-bell-count:hover + .count-label {
    color: #667eea;
    transform: scale(1.05);
}

/* 👤 FOLLOW BUTTON - Enhanced */
.advanced-bell-follow {
    flex-shrink: 0;
}

.advanced-bell-follow-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: #cc0000;
    color: white;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    height: 36px;
    min-width: 100px;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.advanced-bell-follow-btn:hover {
    background: #ff0000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3);
}

/* 🔔 BELL SUBSCRIBE SECTION - Enhanced Colors */
.advanced-bell-subscribe-wrapper {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.advanced-bell-subscribe-dropdown {
    position: relative;
    display: inline-block;
}

.advanced-bell-sub-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: #606060;
    height: 36px;
    min-width: 60px;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.advanced-bell-sub-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.advanced-bell-sub-btn.subscribed {
    color: #3b82f6;
}

.advanced-bell-sub-btn.subscribed::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: #3b82f6;
    border-radius: 18px;
    z-index: -1;
    opacity: 0.1;
}

/* Bell Icon with Emoji */
.advanced-bell-icon {
    font-size: 18px;
    transition: all 0.2s ease;
}

.advanced-bell-sub-btn:hover .advanced-bell-icon {
    transform: scale(1.1);
}

.advanced-bell-sub-btn.subscribed .advanced-bell-icon {
    animation: bellRing 0.5s ease;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.advanced-bell-arrow {
    font-size: 10px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-bell-subscribe-dropdown.open .advanced-bell-arrow {
    transform: rotate(180deg);
}

.advanced-bell-loading {
    display: none;
}

.advanced-bell-sub-btn.loading .advanced-bell-loading {
    display: block;
}

.advanced-bell-sub-btn.loading .advanced-bell-icon,
.advanced-bell-sub-btn.loading .advanced-bell-arrow {
    display: none;
}

/* 📱 DROPDOWN MENU - Working Design */
.advanced-bell-dropdown-menu {
    position: fixed;
    top: auto;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.15), 0 2px 16px rgba(0, 0, 0, 0.1);
    width: 320px;
    max-width: 90vw;
    z-index: 10000;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.advanced-bell-dropdown-menu.show {
    display: block;
    animation: advancedDropdownSlide 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes advancedDropdownSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Dropdown header - YouTube Channel Info */
.advanced-dropdown-header {
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.advanced-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.advanced-channel-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.advanced-channel-details {
    flex: 1;
    min-width: 0;
}

.advanced-channel-name {
    font-weight: 600;
    font-size: 16px;
    color: #0f0f0f;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advanced-channel-stats {
    font-size: 13px;
    color: #606060;
    font-weight: 400;
}

.advanced-sub-count {
    color: #606060;
    font-weight: 500;
}

.advanced-language-badge {
    background: #065fd4;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.advanced-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0;
}

/* Dropdown content - YouTube Menu Items */
.advanced-dropdown-content {
    padding: 8px 0;
}

.advanced-action-section {
    padding: 0 0 8px;
}

.advanced-dropdown-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.1s ease;
    text-align: left;
}

.advanced-dropdown-action-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.advanced-action-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.advanced-action-content {
    flex: 1;
    min-width: 0;
}

.advanced-action-text {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #0f0f0f;
    margin-bottom: 2px;
}

.advanced-action-desc {
    display: block;
    font-size: 12px;
    color: #606060;
    line-height: 1.4;
}

/* Notification options - YouTube Settings */
.advanced-notification-options {
    padding: 0 0 8px;
}

.advanced-option-title {
    font-size: 13px;
    font-weight: 600;
    color: #606060;
    margin-bottom: 8px;
    padding: 0 16px;
    text-transform: none;
    letter-spacing: 0;
}

.advanced-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.1s ease;
    margin-bottom: 0;
    border: none;
    position: relative;
}

.advanced-option-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.advanced-option-item.active {
    background: rgba(6, 95, 212, 0.05);
    border: none;
}

.advanced-option-item.active::before {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #065fd4;
    font-weight: bold;
    font-size: 14px;
}

.advanced-option-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.advanced-option-text {
    font-weight: 500;
    font-size: 14px;
    color: #0f0f0f;
    flex: 1;
}

.advanced-option-desc {
    font-size: 12px;
    color: #606060;
}

/* 🔒 LANGUAGE INDICATOR - HIDDEN */
.advanced-language-indicator {
    display: none !important;
}

/* BACKDROP - YouTube Style */
.advanced-bell-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

.advanced-bell-backdrop.show {
    display: block;
    animation: advancedBackdropFadeIn 0.2s ease;
}

@keyframes advancedBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 📱 MOBILE RESPONSIVE - All Devices */
@media (max-width: 1200px) {
    .advanced-bell-single-line {
        gap: 10px;
    }
    
    .advanced-bell-btn {
        min-width: 75px;
        padding: 8px 14px;
    }
    
    .advanced-bell-follow-btn {
        min-width: 95px;
    }
    
    .advanced-bell-sub-btn {
        min-width: 55px;
    }
}

@media (max-width: 768px) {
    .advanced-bell-single-line {
        gap: 8px;
        padding: 12px 0;
    }
    
    .advanced-bell-btn {
        padding: 6px 12px;
        font-size: 13px;
        height: 32px;
        min-width: 70px;
    }
    
    .advanced-bell-follow-btn {
        padding: 8px 14px;
        font-size: 13px;
        height: 32px;
        min-width: 90px;
    }
    
    .advanced-bell-sub-btn {
        padding: 6px 12px;
        font-size: 13px;
        height: 32px;
        min-width: 50px;
    }
    
    .advanced-bell-count {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 35px;
    }
    
    .advanced-bell-dropdown-menu {
        width: 95vw;
        max-width: 300px;
    }
    
    .advanced-channel-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .advanced-channel-name {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .advanced-bell-single-line {
        gap: 6px;
        padding: 8px 0;
    }
    
    .advanced-bell-btn {
        padding: 5px 10px;
        font-size: 12px;
        height: 30px;
        min-width: 60px;
    }
    
    .advanced-bell-follow-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 30px;
        min-width: 80px;
    }
    
    .advanced-bell-sub-btn {
        padding: 5px 10px;
        font-size: 12px;
        height: 30px;
        min-width: 45px;
    }
    
    .advanced-bell-count {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 30px;
    }
    
    .count-label {
        font-size: 9px;
    }
    
    .advanced-bell-dropdown-menu {
        width: 98vw;
        max-width: 280px;
    }
    
    .advanced-dropdown-header {
        padding: 12px;
    }
    
    .advanced-author-info {
        gap: 10px;
    }
    
    .advanced-channel-avatar img {
        width: 36px;
        height: 36px;
    }
    
    .advanced-channel-name {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .advanced-bell-btn {
        padding: 4px 8px;
        font-size: 11px;
        height: 28px;
        min-width: 55px;
    }
    
    .advanced-bell-follow-btn {
        padding: 5px 10px;
        font-size: 11px;
        height: 28px;
        min-width: 75px;
    }
    
    .advanced-bell-sub-btn {
        padding: 4px 8px;
        font-size: 11px;
        height: 28px;
        min-width: 40px;
    }
    
    .advanced-bell-count {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 25px;
    }
    
    .advanced-bell-dropdown-menu {
        max-width: 260px;
    }
}

/* 🎯 YOUTUBE STYLE MICRO-INTERACTIONS */

/* Loading States */
.advanced-bell-btn.loading,
.advanced-bell-sub-btn.loading {
    position: relative;
    color: transparent !important;
}

.advanced-bell-btn.loading::after,
.advanced-bell-sub-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #606060;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.advanced-bell-btn.active.loading::after,
.advanced-bell-sub-btn.subscribed.loading::after {
    border-top-color: #065fd4;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation for Active States */
.advanced-bell-btn.active.pulse {
    animation: youtubePulse 0.4s ease;
}

.advanced-bell-sub-btn.subscribed.pulse {
    animation: youtubePulse 0.4s ease;
}

@keyframes youtubePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Smooth Count Updates */
.advanced-bell-count.counting {
    animation: countUpdate 0.3s ease;
}

@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Dropdown Update Animation */
.advanced-bell-dropdown-menu.updating {
    opacity: 0.7;
    pointer-events: none;
}

/* YouTube Style Focus States */
.advanced-bell-btn:focus-visible,
.advanced-bell-sub-btn:focus-visible,
.advanced-dropdown-action-btn:focus-visible,
.advanced-option-item:focus-visible {
    outline: 2px solid #065fd4;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .advanced-bell-btn {
        color: #aaa;
    }
    
    .advanced-bell-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .advanced-bell-btn.active {
        color: #3ea6ff;
    }
    
    .advanced-bell-btn.active::before {
        background: #3ea6ff;
    }
    
    .advanced-bell-dropdown-menu {
        background: #212121;
        border-color: #303030;
        box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
    }
    
    .advanced-dropdown-header {
        background: #181818;
        border-bottom-color: #303030;
    }
    
    .advanced-channel-name {
        color: #f1f1f1;
    }
    
    .advanced-channel-stats {
        color: #aaa;
    }
    
    .advanced-dropdown-action-btn:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .advanced-action-text {
        color: #f1f1f1;
    }
    
    .advanced-action-desc {
        color: #aaa;
    }
    
    .advanced-option-title {
        color: #aaa;
    }
    
    .advanced-option-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .advanced-option-item.active {
        background: rgba(62, 166, 255, 0.1);
    }
    
    .advanced-option-text {
        color: #f1f1f1;
    }
    
    .advanced-option-desc {
        color: #aaa;
    }
    
    .advanced-bell-sub-btn.subscribed {
        color: #3ea6ff;
    }
    
    .advanced-bell-sub-btn.subscribed::before {
        background: #3ea6ff;
    }
    
    .advanced-language-badge {
        background: #3ea6ff;
    }
}

/* 🚀 PERFORMANCE OPTIMIZATIONS */
@media (prefers-reduced-motion: reduce) {
    .advanced-bell-btn,
    .advanced-bell-sub-btn,
    .advanced-dropdown-action-btn,
    .advanced-option-item {
        transition: none;
        animation: none;
    }
    
    .advanced-bell-dropdown-menu {
        animation: none;
    }
}

/* 🚀 IMPORTANT: Ensure all buttons are visible */
.advanced-bell-btn,
.advanced-bell-sub-btn,
.advanced-bell-follow-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.advanced-reaction-wrapper,
.advanced-bell-follow,
.advanced-bell-subscribe-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}