/**
 * Broadcast Popup - Styles
 * פופאפ הודעות כריזה - עיצוב
 */

/* Overlay */
.broadcast-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: broadcastFadeIn 0.3s ease;
}

@keyframes broadcastFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container */
.broadcast-popup-container {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: broadcastSlideUp 0.4s ease;
}

@keyframes broadcastSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.broadcast-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
    z-index: 10;
}

.broadcast-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

/* Header */
.broadcast-popup-header {
    padding: 32px 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.broadcast-popup-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: broadcastPulse 2s ease infinite;
}

@keyframes broadcastPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6);
    }
}

/* Priority Badge */
.broadcast-popup-priority {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.broadcast-popup-priority.urgent {
    background: #fee2e2;
    color: #dc2626;
}

.broadcast-popup-priority.important {
    background: #fef3c7;
    color: #d97706;
}

/* Title */
.broadcast-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    padding: 16px 32px 8px;
    line-height: 1.4;
}

/* Content */
.broadcast-popup-content {
    padding: 8px 32px 24px;
    font-size: 15px;
    line-height: 1.7;
    color: #495057;
    text-align: right;
    max-height: 200px;
    overflow-y: auto;
    flex: 1;
}

.broadcast-popup-content ul,
.broadcast-popup-content ol {
    margin: 10px 0;
    padding-right: 24px;
    padding-left: 0;
    text-align: right;
}

.broadcast-popup-content li {
    margin-bottom: 6px;
    text-align: right;
}

.broadcast-popup-content::-webkit-scrollbar {
    width: 6px;
}

.broadcast-popup-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

/* Author & Date */
.broadcast-popup-author {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    padding: 0 32px;
    display: none;
}

.broadcast-popup-date {
    font-size: 12px;
    color: #adb5bd;
    text-align: center;
    padding: 8px 32px 16px;
}

/* Navigation */
.broadcast-popup-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 32px 20px;
}

.popup-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f4;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.2s;
}

.popup-nav-btn:hover:not(:disabled) {
    background: #e9ecef;
    color: #667eea;
}

.popup-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.popup-nav-dots {
    display: flex;
    gap: 8px;
}

.popup-dot {
    width: 8px;
    height: 8px;
    background: #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.popup-dot:hover {
    background: #adb5bd;
}

.popup-dot.active {
    background: #667eea;
    width: 24px;
    border-radius: 4px;
}

/* Acknowledge Button */
.broadcast-popup-btn {
    margin: 0 32px 32px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.broadcast-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.45);
}

.broadcast-popup-btn:active {
    transform: translateY(0);
}

.broadcast-popup-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Already Read State */
.broadcast-popup-already-read {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 32px 32px;
    padding: 14px;
    background: #d1fae5;
    color: #059669;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.broadcast-popup-already-read i {
    font-size: 16px;
}

/* Header Button Styles (for CRM.Master) */
.broadcast-wrapper {
    position: relative;
    display: none;
}

.broadcast-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    transition: all 0.2s;
    position: relative;
}

.broadcast-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

.broadcast-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* New broadcast flash animation */
.new-broadcast-flash {
    animation: newBroadcastFlash 0.5s ease 6 !important;
}

@keyframes newBroadcastFlash {
    0%, 100% {
        background: #dc2626;
        transform: scale(1);
    }
    50% {
        background: #22c55e;
        transform: scale(1.3);
    }
}

/* Customer Portal Button Styles (for MyCases) */
.customer-broadcast-wrapper {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
}

/* Hide broadcast button when modal is open */
body.modal-open .customer-broadcast-wrapper {
    display: none !important;
}

.customer-broadcast-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.customer-broadcast-btn:hover {
    transform: scale(1.1);
}

.customer-broadcast-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #dc2626;
    color: white;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .broadcast-popup-container {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        max-height: 90vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .broadcast-popup-header {
        padding: 24px 24px 0;
    }

    .broadcast-popup-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .broadcast-popup-title {
        font-size: 20px;
        padding: 12px 24px 8px;
    }

    .broadcast-popup-content {
        padding: 8px 24px 20px;
        font-size: 14px;
    }

    .broadcast-popup-btn {
        margin: 0 24px 24px;
        padding: 14px 20px;
        font-size: 15px;
    }

    .broadcast-popup-already-read {
        margin: 0 24px 24px;
    }
}

/* Attachments */
.broadcast-popup-attachments {
    margin: 0 32px 16px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
}

.attachments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
    margin-bottom: 10px;
}

.attachments-header i {
    color: var(--accent-color, #5B8DEF);
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary, #1f2937);
    transition: all 0.2s ease;
}

.attachment-link:hover {
    background: var(--bg-secondary, #f3f4f6);
    border-color: var(--accent-color, #5B8DEF);
}

.attachment-link i {
    color: var(--accent-color, #5B8DEF);
    font-size: 16px;
}

.attachment-name {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
}

.attachment-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--accent-color, #5B8DEF);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 8px;
}

.attachment-download:hover {
    background: #4a7de0;
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .broadcast-popup-attachments {
        margin: 0 24px 16px;
    }
}

/* RTL Support */
[dir="rtl"] .broadcast-popup-close {
    left: auto;
    right: 16px;
}

[dir="rtl"] .popup-nav-btn i.fa-chevron-right {
    transform: rotate(180deg);
}

[dir="rtl"] .popup-nav-btn i.fa-chevron-left {
    transform: rotate(180deg);
}
