/**
 * CRYPTO TEK AI - NOTIFICATIONS CSS
 * Watchlist opportunity notifications styling
 */

/* ==================== NOTIFICATION BELL ==================== */

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

#notifications-btn {
    position: relative;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

#notifications-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

#notifications-btn.has-notifications {
    /* animation removed */
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    pointer-events: none;
}

/* ==================== NOTIFICATION MODAL ==================== */

.notifications-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notifications-modal.active {
    opacity: 1;
    pointer-events: all;
}

.notifications-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.notifications-panel {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.notifications-modal.active .notifications-panel {
    right: 0;
}

/* ==================== NOTIFICATION HEADER ==================== */

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.notifications-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifications-header-left i {
    font-size: 24px;
}

.notifications-header-left h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.notifications-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.notifications-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ==================== NOTIFICATION CONTENT ==================== */

.notifications-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notifications-content::-webkit-scrollbar {
    width: 6px;
}

.notifications-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.notifications-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* ==================== OPPORTUNITY CARDS ==================== */

.opportunity-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.opportunity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.opportunity-card.buy {
    border-left-color: #4caf50;
}

.opportunity-card.sell {
    border-left-color: #f44336;
}

.opportunity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.opportunity-title {
    flex: 1;
}

.symbol-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.symbol-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.symbol-direction {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.symbol-direction.buy {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.symbol-direction.sell {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.opportunity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.timeframe,
.exchange {
    padding: 2px 6px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 4px;
    font-weight: 600;
}

.opportunity-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.expand-btn {
    background: rgba(255, 107, 53, 0.1);
    border: none;
    color: var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.expand-btn:hover {
    background: rgba(255, 107, 53, 0.2);
    transform: scale(1.1);
}

.opportunity-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ai-decision {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.time-ago {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== OPPORTUNITY DETAILS ==================== */

.opportunity-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.opportunity-card.expanded .opportunity-details {
    margin-top: 12px;
}

.details-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
}

.details-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.details-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-zone {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zone-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.zone-divider {
    color: var(--text-secondary);
}

.zone-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 107, 53, 0.08);
    border-radius: 6px;
    font-size: 14px;
}

.zone-entry .label {
    color: var(--text-secondary);
}

.zone-entry .value {
    font-weight: 600;
    color: var(--text-primary);
}

.targets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.target-item {
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.target-item.tp {
    background: rgba(76, 175, 80, 0.1);
}

.target-item.sl {
    background: rgba(244, 67, 54, 0.1);
}

.target-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.target-value {
    font-size: 16px;
    font-weight: 700;
}

.target-item.tp .target-value {
    color: #4caf50;
}

.target-item.sl .target-value {
    color: #f44336;
}

.indicators-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 6px;
    font-size: 13px;
}

.indicator-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.indicator-value {
    font-weight: 700;
    color: var(--text-primary);
}

.ai-evaluation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 142, 102, 0.1));
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.ai-score .label {
    color: var(--text-secondary);
}

.ai-score .value {
    color: var(--primary-color);
    font-weight: 700;
}

.ai-reason {
    padding: 12px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.risk-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 6px;
}

.risk-item.risk {
    background: rgba(244, 67, 54, 0.1);
}

.risk-item.reward {
    background: rgba(76, 175, 80, 0.1);
}

.risk-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.risk-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.risk-item.risk .risk-value {
    color: #f44336;
}

.risk-item.reward .risk-value {
    color: #4caf50;
}

/* ==================== EMPTY STATE ==================== */

.notifications-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.notifications-empty i {
    font-size: 64px;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 20px;
}

.notifications-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.notifications-empty p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 280px;
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.notification-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    pointer-events: none;
}

.notification-toast {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    border-left: 4px solid var(--primary-color);
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.watchlist-alert {
    border-left-color: #00ff88;
}

.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.toast-icon {
    font-size: 20px;
    margin-right: 8px;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    flex: 1;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.toast-body {
    padding: 16px;
}

.toast-symbol {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.toast-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.toast-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.toast-value {
    color: var(--text-primary);
    font-weight: 600;
}

.toast-confidence {
    margin-top: 12px;
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 107, 53, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00ff88);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.confidence-text {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Toast Animation removed */

/* Mobile Responsive */
@media (max-width: 480px) {
    .notification-toast-container {
        right: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
    }

    .notification-toast {
        width: 100%;
    }
}

/* ==================== ANALYSIS RESULT MODAL ==================== */

.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001; /* En üstte göster - chart modal'dan bile yüksek */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.analysis-modal.show {
    opacity: 1;
    pointer-events: all;
}

.analysis-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1; /* Overlay arkada */
}

.analysis-modal .modal-container {
    position: relative;
    z-index: 2; /* Container önde */
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.analysis-modal.show .modal-container {
    transform: scale(1);
}

.analysis-modal .modal-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(124, 58, 237, 0.2));
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.analysis-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.analysis-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.analysis-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.analysis-modal .modal-body.error {
    text-align: center;
}

.analysis-modal .error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.analysis-modal .no-signal-icon {
    font-size: 64px;
    margin-bottom: 16px;
    text-align: center;
}

.analysis-modal .quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.analysis-modal .stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.analysis-modal .stat-label {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.analysis-modal .stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.analysis-modal .rsi-section {
    margin: 16px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.analysis-modal .rsi-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.analysis-modal .rsi-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.analysis-modal .rsi-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.analysis-modal .action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.analysis-modal .action-buttons button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.analysis-modal .btn-view-details {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}

.analysis-modal .btn-view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.analysis-modal .btn-retry {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.analysis-modal .btn-retry:hover {
    background: rgba(255, 255, 255, 0.15);
}

.analysis-modal .btn-watchlist-toggle {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.analysis-modal .btn-watchlist-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.analysis-modal .btn-watchlist-toggle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.analysis-modal .retry-section {
    margin-top: 24px;
}

.analysis-modal .mtf-confirmation {
    text-align: center;
}

.analysis-modal .mtf-badge {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.analysis-modal .mtf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.analysis-modal .mtf-stats .stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
}

.analysis-modal .mtf-stats .label {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.analysis-modal .mtf-stats .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.analysis-modal .signal-summary {
    text-align: center;
    margin-bottom: 20px;
}

.analysis-modal .summary-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.analysis-modal .signal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-modal .signal-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.analysis-modal .signal-tf {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.analysis-modal .signal-direction {
    font-weight: 600;
}

.analysis-modal .signal-confidence {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.analysis-modal .signal-confidence .confidence-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.analysis-modal .signal-confidence .confidence-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.analysis-modal .signal-confidence span {
    font-size: 11px;
    font-weight: 600;
    min-width: 35px;
}

.analysis-modal .more-signals {
    text-align: center;
    font-size: 13px;
    opacity: 0.7;
    margin-top: 8px;
}

.analysis-modal .modal-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-modal .job-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.7;
}

.analysis-modal .job-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toast Notification Ekstraları */
.notification-toast.analysis-result {
    min-width: 320px;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.98), rgba(40, 40, 50, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-toast .toast-action {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    opacity: 0.7;
}

/* Notification Icon Wrapper */
.notification-icon-wrapper {
    position: relative;
}

.notification-icon-wrapper .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 480px) {
    .notifications-panel {
        max-width: 100%;
    }

    .symbol-name {
        font-size: 16px;
    }

    .targets-grid,
    .indicators-grid,
    .risk-grid {
        grid-template-columns: 1fr;
    }

    .analysis-modal .modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .analysis-modal .modal-body {
        padding: 16px;
    }

    .analysis-modal .modal-header {
        padding: 16px;
    }

    .analysis-modal .action-buttons {
        flex-direction: column;
    }

    .analysis-modal .mtf-stats {
        grid-template-columns: 1fr;
    }
}
