/**
 * UNITY 2B3 Components CSS
 * Styles for dynamically loaded components
 */

/* ===========================================
   LOADING OVERLAY
   =========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s, visibility 0.3s;
}
.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* ===========================================
   TOAST NOTIFICATIONS
   =========================================== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success-text, #22c55e);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast-notification.visible {
    transform: translateY(0);
    opacity: 1;
}
.toast-notification.error { background: #ef4444; }
.toast-notification.warning { background: #f59e0b; }

/* ===========================================
   SIDEBAR SHARE BUTTON
   =========================================== */
.sidebar-share-section {
    position: sticky;
    bottom: 0;
    padding: 8px;
    margin-top: auto;
    background: rgba(26, 26, 26, 0.98);
}

/* Mobile: Make share section scroll with content */
@media (max-width: 1024px) {
    .sidebar.mobile-open .sidebar-share-section {
        position: relative;
        bottom: auto;
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 12px;
    }
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-height: 40px;
    padding: 7px 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124,58,237,0.4);
}
.sidebar.minimized .share-btn .share-text { display: none; }
.sidebar.minimized .share-btn { padding: 7px; width: 40px; margin:auto; }

/* ===========================================
   NOTIFICATION PANEL
   =========================================== */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s;
    box-shadow: -5px 0 30px rgba(0,0,0,0.3);
}
.notification-panel.active {
    right: 0;
        transform: translateX(0) !important;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.notification-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.notification-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.notification-panel-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.notification-panel-filters {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.notification-filter {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}
.notification-filter:hover,
.notification-filter.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}
.notification-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 8px;
    position: relative;
}
.notification-item:hover {
    border-color: var(--accent-primary);
}
.notification-item.unread {
    background: rgba(124,58,237,0.05);
    border-color: rgba(124,58,237,0.2);
}
.notification-indicator {
    position: absolute;
    top: 16px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: none;
}
.notification-item.unread .notification-indicator { display: block; }
.notification-icon { font-size: 24px; flex-shrink: 0; }
.notification-content { flex: 1; min-width: 0; }
.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.4;
}
.notification-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.notification-time {
    font-size: 12px;
    color: var(--text-tertiary);
}
.notification-action {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--accent-primary);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.notification-action:hover { background: var(--accent-secondary); }
.notification-panel-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}
.notification-footer-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.notification-footer-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.notification-footer-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}
.notification-footer-btn.primary:hover { background: var(--accent-secondary); }

/* Notification Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===========================================
   SHARE MODAL
   =========================================== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.share-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.share-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.share-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.share-modal-body { padding: 24px; }
.share-modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 20px;
    font-size: 14px;
}
.share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.share-social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.share-social-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}
.share-social-btn .social-icon { font-size: 24px; }
.share-social-btn.whatsapp:hover { border-color: #25D366; }
.share-social-btn.twitter:hover { border-color: #1DA1F2; }
.share-social-btn.linkedin:hover { border-color: #0A66C2; }
.share-social-btn.telegram:hover { border-color: #0088cc; }
.share-social-btn.email:hover { border-color: #EA4335; }
.share-social-btn.facebook:hover { border-color: #1877F2; }
.share-link-section {
    display: flex;
    gap: 8px;
}
.share-link-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}
.share-link-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}
.copy-link-btn {
    padding: 12px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.copy-link-btn:hover { background: var(--accent-secondary); }

/* ===========================================
   UNITY TV
   =========================================== */
.video-card { min-height: 400px; }
.video-container {
    display: flex;
    gap: 0;
    min-height: 350px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.video-player-area {
    flex: 1;
    position: relative;
    min-height: 350px;
    background: #0a0a0a;
}
.video-content {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.video-content.active { display: block; }
.video-content iframe {
    width: 100%;
    height: 100%;
    min-height: 350px;
    border: none;
}
.video-tabs {
    display: flex;
    flex-direction: column;
    width: 160px;
    background: linear-gradient(180deg, #1a1a2e, #16213e);
    border-left: 1px solid rgba(255,255,255,0.1);
}
.video-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 87px;
}
.video-tab:last-child { border-bottom: none; }
.video-tab:hover {
    background: rgba(124,58,237,0.2);
    color: rgba(255,255,255,0.9);
}
.video-tab.active {
    background: linear-gradient(135deg, rgba(124,58,237,0.4), rgba(99,102,241,0.3));
    color: #fff;
    border-left: 3px solid var(--accent-primary);
}
.tab-icon { font-size: 24px; margin-bottom: 0px; }
.tab-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.3;
}
.live-indicator-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1s infinite;
}
.live-session-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 350px;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
}
.no-live-session {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.no-live-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.live-session-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}
.live-session-content p {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 4px;
}
.next-session-info {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(124,58,237,0.2);
    border-radius: 8px;
    color: var(--accent-primary);
    font-weight: 500;
    border: 1px solid rgba(124,58,237,0.3);
}
.live-meeting-available { display: flex; flex-direction: column; align-items: center; }
.live-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    padding: 10px 24px;
    border-radius: 30px;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: liveGlow 2s infinite;
}
.live-pulse {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: livePulse 1s infinite;
}
.join-zoom-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.join-zoom-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(124,58,237,0.5);
}
.join-note { margin-top: 12px !important; font-size: 12px !important; opacity: 0.5; }
.zoom-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-text, #22c55e);
}
@keyframes liveGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 40px rgba(239,68,68,0.7); }
}
@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Unity TV Responsive */
@media (max-width: 768px) {
    .video-container { flex-direction: column; }
    .video-tabs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .video-tab {
        flex: 1;
        min-width: 80px;
        min-height: auto;
        padding: 12px 8px;
        border-bottom: none;
        border-right: 1px solid rgba(255,255,255,0.1);
    }
    .video-tab:last-child { border-right: none; }
    .video-tab.active { border-left: none; border-top: 3px solid var(--accent-primary); }
    .tab-icon { font-size: 20px; margin-bottom: 4px; }
    .tab-text { font-size: 9px; }
    .video-player-area { min-height: 250px; }
    .video-content iframe { min-height: 250px; }
    .live-session-content { min-height: 250px; padding: 20px; }
}

/* ===========================================
   PROFILE IMAGE
   =========================================== */
.profile-image,
.profile-image-large {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: grid;
    place-items: center;
    font-weight: 700;
    user-select: none;
}

/* ===========================================
   LOGO THEME SWITCHING
   =========================================== */
.logo-link img { max-height: 36px; width: auto; }
.logo-link .logo-light { display: none; }
.logo-link .logo-dark { display: block; }
.light-theme .logo-link .logo-light { display: block; }
.light-theme .logo-link .logo-dark { display: none; }

/* ===========================================
   PROFILE PANEL (Slide-out)
   =========================================== */
.profile-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0,0,0,0.3);
    overflow-y: auto;
}
.profile-panel.active {
    right: 0;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.profile-panel-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px;
}
.profile-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.profile-panel-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.profile-panel-content {
    padding: 0 20px 20px;
}

/* Profile Card */
.profile-panel-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 16px;
}
.profile-panel-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--accent-primary);
}
.profile-panel-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.profile-panel-location {
    font-size: 14px;
    color: var(--accent-primary);
    margin: 0 0 4px;
}
.profile-panel-date {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 20px;
}
.profile-panel-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.profile-stat {
    text-align: center;
}
.profile-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}
.profile-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Actions */
.profile-panel-actions {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}
.profile-actions-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}
.profile-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.profile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.profile-action-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}
.profile-action-icon {
    font-size: 24px;
    color: var(--accent-primary);
}
.profile-action-text {
    font-size: 13px;
    font-weight: 500;
}

/* Menu Links */
.profile-panel-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-panel-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.profile-panel-link:hover {
    border-color: var(--accent-primary);
    background: rgba(124,58,237,0.1);
}
.profile-link-icon {
    font-size: 18px;
}
.profile-panel-logout:hover {
    border-color: #ef4444;
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

/* Profile Panel Overlay */
.profile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.profile-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .profile-panel {
        width: 100%;
        right: -100%;
    }
    .profile-panel-stats {
        gap: 20px;
    }
    .profile-stat-value {
        font-size: 20px;
    }
}