/* /portal/_components/PortalHeader/PortalHeader.css */

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 100;
}

.header-logo-mobile { display: block; }
.header-logo-mobile img { width: 35px; height: 35px; border-radius: 50%; }

.user-greeting { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* --- SOS BUTTON STYLES --- */
.sos-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #e74c3c;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.4);
    transition: transform 0.1s ease, background-color 0.2s;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.sos-btn:active {
    transform: scale(0.95);
    background-color: #c0392b;
}

.sos-label {
    color: white;
    font-weight: 800;
    font-size: 12px;
    z-index: 2;
    pointer-events: none;
}

/* Progress Ring */
.sos-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg); /* Start from top */
    z-index: 1;
    pointer-events: none;
}

.progress-ring__circle {
    stroke-dasharray: 126; /* Circumference of r=20 (2 * pi * 20) */
    stroke-dashoffset: 126; /* Start empty */
    transition: stroke-dashoffset 0s linear; /* Default no transition */
}

/* When active (holding), animate the dashoffset to 0 over 5 seconds */
.sos-btn.holding .progress-ring__circle {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 5s linear;
}

/* Pulsing effect while holding */
.sos-btn.holding {
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}


/* --- Existing Icon Styles --- */
.header-icon-btn {
    font-size: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    position: relative;
}
.header-icon-btn:hover {
    background-color: var(--portal-background);
    color: var(--text-primary);
}

.notification-badge-dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 8px; height: 8px;
    background-color: #e74c3c;
    border-radius: 50%;
    border: 1px solid white;
}

.profile-avatar { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

.profile-menu-container { position: relative; }
.profile-dropdown {
    position: absolute; top: 55px; width: 220px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 200; overflow: hidden;
    opacity: 1; transform: translateY(0); transition: all 0.2s ease-out;
}
[dir="ltr"] .profile-dropdown { right: 0; }
[dir="rtl"] .profile-dropdown { left: 0; }
.profile-dropdown.popup-hidden { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.profile-dropdown a {
    display: flex; align-items: center; gap: 15px; padding: 12px 15px;
    text-decoration: none; color: var(--text-primary); font-size: 15px; font-weight: 500;
}
.profile-dropdown a:hover { background-color: var(--portal-background); }

@media (min-width: 992px) {
    .portal-header { padding: 20px 30px; }
    .header-logo-mobile { display: none; }
    .user-greeting { display: block; }
    .user-greeting h1 { font-size: 24px; font-weight: 700; margin: 0; }
    .user-greeting p { color: var(--text-secondary); margin: 2px 0 0; font-size: 14px; }

    /* Bigger SOS on desktop */
    .sos-btn { width: 50px; height: 50px; }
    .sos-progress-ring { width: 50px; height: 50px; }
    .progress-ring__circle { cx: 25; cy: 25; }
}