/* ============================================
   HEADER & NOTIFICATIONS — общие стили для всех страниц
   ============================================ */

/* ----- ХЕДЕР ----- */
.header {
    padding: 20px 0;
    border-bottom: 1px solid #1E1E1E;
    background: rgba(10,10,10,0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-shrink: 0;
}
.logo a {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.logo__text {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFFFFF, #00E599);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo__badge {
    font-size: 0.7rem;
    color: #00E599;
    background: rgba(0, 229, 153, 0.1);
    padding: 3px 8px;
    border-radius: 30px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.live-indicator {
    font-size: 0.8rem;
    color: #00E599;
    background: rgba(0, 229, 153, 0.05);
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.live-dot {
    width: 8px;
    height: 8px;
    background-color: #00E599;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #00E599;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.user-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== ИСТОЧНИК ЦЕН ===== */
.price-source-selector {
    position: relative;
    display: flex;
    align-items: center;
}
.price-source-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 2px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 229, 153, 0.1);
}
.price-source-btn:hover {
    background: rgba(0, 229, 153, 0.1);
    box-shadow: 0 0 20px rgba(0, 229, 153, 0.3);
    transform: scale(1.05);
}
.price-source-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.price-source-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 14px;
    padding: 6px 0;
    box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 40px rgba(0,229,153,0.05);
    display: none;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.price-source-selector:hover .price-source-dropdown,
.price-source-dropdown:hover {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.price-source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    color: #CCC;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.price-source-item:hover {
    background: rgba(0, 229, 153, 0.08);
    color: #E8E8E8;
}
.price-source-item.active {
    color: #00E599 !important;
    background: rgba(0, 229, 153, 0.06);
}
.price-source-item .source-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.05);
}
.price-source-item .source-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.price-source-item .source-name {
    flex: 1;
    font-size: 0.8rem;
}

/* ===== ВАЛЮТА ===== */
.currency-selector {
    position: relative;
    display: flex;
    align-items: center;
}
.currency-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid #00E599;
    color: #00E599;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 229, 153, 0.2);
    text-shadow: 0 0 8px rgba(0, 229, 153, 0.3);
    font-family: inherit;
    padding: 0;
    line-height: 1;
}
.currency-btn:hover {
    background: rgba(0, 229, 153, 0.08);
    box-shadow: 0 0 20px rgba(0, 229, 153, 0.4);
    transform: scale(1.05);
}
.currency-btn .symbol {
    font-size: 1.2rem;
    line-height: 1;
}

.currency-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 170px;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 14px;
    padding: 6px 0;
    box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 40px rgba(0,229,153,0.05);
    display: none;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.currency-selector:hover .currency-dropdown,
.currency-dropdown:hover {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.currency-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    color: #CCC;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.currency-dropdown-item:hover {
    background: rgba(0, 229, 153, 0.08);
    color: #E8E8E8;
}
.currency-dropdown-item.active {
    color: #00E599 !important;
    background: rgba(0, 229, 153, 0.06);
}
.currency-dropdown-item .currency-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #00E599;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #00E599;
    flex-shrink: 0;
    background: transparent;
    box-shadow: 0 0 8px rgba(0, 229, 153, 0.15);
    transition: all 0.2s ease;
}
.currency-dropdown-item:hover .currency-circle {
    background: rgba(0, 229, 153, 0.1);
    box-shadow: 0 0 16px rgba(0, 229, 153, 0.3);
}
.currency-dropdown-item.active .currency-circle {
    background: rgba(0, 229, 153, 0.15);
    box-shadow: 0 0 20px rgba(0, 229, 153, 0.4);
}
.currency-dropdown-item .currency-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.8rem;
    min-width: 35px;
}
.currency-dropdown-item .currency-rate {
    font-weight: 400;
    font-size: 0.8rem;
    color: #DDD;
    margin-left: auto;
    white-space: nowrap;
}
.currency-dropdown-item.active .currency-rate {
    color: #00E599;
}

/* ===== МЕНЮ ПОЛЬЗОВАТЕЛЯ ===== */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}
.user-menu .avatar {
    width: 36px;
    height: 36px;
    background: #2A2A2A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid #00E599;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}
.user-menu .avatar:hover {
    transform: scale(1.05);
}
.user-menu .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-menu .username {
    font-weight: 500;
    font-size: 0.85rem;
    color: #E8E8E8;
}
.user-menu .dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: -40px;
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 14px;
    width: 160px;
    padding: 6px 0;
    z-index: 100;
    display: none;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.user-menu:hover .dropdown,
.user-menu .dropdown:hover {
    display: flex;
    opacity: 1;
    visibility: visible;
}
.user-menu .dropdown a,
.user-menu .dropdown button {
    display: block;
    padding: 8px 14px;
    color: #E8E8E8;
    text-decoration: none;
    font-size: 0.8rem;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}
.user-menu .dropdown a:hover,
.user-menu .dropdown button:hover {
    background: #2A2A2A;
    color: #00E599;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bell-btn {
    background: transparent;
    border: none;
    color: #00E599;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.bell-btn:hover {
    color: #00ffaa;
    background: rgba(0, 229, 153, 0.1);
    box-shadow: 0 0 20px rgba(0, 229, 153, 0.3);
    transform: scale(1.05);
}
.bell-btn svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px rgba(0,229,153,0.3));
}
.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3355;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #0A0A0A;
    box-shadow: 0 0 12px rgba(255,51,85,0.5);
    transition: transform 0.2s ease;
}
.badge.hidden {
    transform: scale(0);
    opacity: 0;
}
.badge.pulse {
    animation: badgePulse 1.5s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 420px;
    max-height: 460px;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 40px rgba(0,229,153,0.05);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.notification-bell:hover .notification-dropdown,
.notification-dropdown:hover {
    display: flex;
    opacity: 1;
    visibility: visible;
}
.notification-dropdown.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #2A2A2A;
    font-weight: 600;
    font-size: 0.95rem;
    color: #E8E8E8;
    flex-shrink: 0;
}
.mark-all-btn {
    background: transparent;
    border: none;
    color: #00E599;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}
.mark-all-btn:hover {
    background: rgba(0,229,153,0.1);
    color: #00ffaa;
}

.notification-list {
    overflow-y: auto;
    max-height: 380px;
    padding: 4px 0;
    flex: 1;
}
.notification-list::-webkit-scrollbar {
    width: 4px;
}
.notification-list::-webkit-scrollbar-track {
    background: transparent;
}
.notification-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #1E1E1E;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #E8E8E8;
    position: relative;
}
.notification-item:hover {
    background: #222;
}
.notification-item.unread {
    border-left: 3px solid #00E599;
    background: rgba(0,229,153,0.03);
}
.notification-item.unread:hover {
    background: rgba(0,229,153,0.08);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,229,153,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #00E599;
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}
.notification-message {
    font-size: 0.78rem;
    color: #AAA;
    word-break: break-word;
}
.notification-time {
    font-size: 0.65rem;
    color: #666;
    margin-top: 4px;
}
.notification-empty {
    padding: 32px 20px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.notification-delete-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid #ff3355;
    color: #ff3355;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin-top: 2px;
    box-shadow: 0 0 8px rgba(255, 51, 85, 0.2);
    text-shadow: 0 0 8px rgba(255, 51, 85, 0.3);
}
.notification-delete-btn:hover {
    background: rgba(255, 51, 85, 0.15);
    box-shadow: 0 0 20px rgba(255, 51, 85, 0.4);
    transform: scale(1.1);
}
.notification-delete-btn svg {
    width: 16px;
    height: 16px;
    stroke: #ff3355;
    filter: drop-shadow(0 0 4px rgba(255, 51, 85, 0.3));
}
.notification-delete-btn:hover svg {
    filter: drop-shadow(0 0 8px rgba(255, 51, 85, 0.6));
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .header__container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .header-center {
        order: 3;
        flex: 0 0 100%;
        margin-top: 8px;
    }
    .header-right {
        order: 2;
        gap: 6px;
    }
    .logo {
        order: 1;
    }
    .username {
        display: none;
    }
    .user-menu .dropdown {
        right: -10px;
    }
    .price-source-dropdown,
    .currency-dropdown {
        right: -10px;
        min-width: 150px;
    }
}
@media (max-width: 600px) {
    .notification-dropdown {
        width: 340px;
        right: -20px;
    }
}