/* ============================================================
   shared_header.css — Unified header/footer for Connect & Journal
   ============================================================ */

/* ── Global Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Header Wrap (full-width background + border) ── */
.shared-header-wrap {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* overflow: hidden;  -- 通知ドロップダウンが切り取られるため visible に変更 */
    overflow: visible;
    max-width: 100%;
}

/* ── Header Inner (centered content) ── */
/* Reset: style5.css の汎用 header セレクタを上書き */
.shared-header-wrap header.shared-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
    position: static;
    top: auto;
    z-index: auto;
    border-bottom: none;
    background-color: #fff;
}

/* shared-header 内の全要素に box-sizing を適用 */
.shared-header-wrap,
.shared-header-wrap * {
    box-sizing: border-box;
}

/* shared-header 内の img サイズをリセット */
.shared-header-wrap img {
    max-width: 100%;
    height: auto;
}

.shared-header .shared-search-form button img {
    width: 16px;
    height: 16px;
}

.shared-header .shared-header-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.shared-header .shared-header-bell img {
    width: 22px;
    height: 22px;
}

/* ── Left: Logo + Nav ── */
.shared-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.shared-logo {
    display: flex;
    align-items: center;
}

.shared-logo img {
    height: 28px;
    width: auto;
}

.shared-section-nav {
    display: flex;
    gap: 16px;
    margin-left: 8px;
}

.shared-section-nav a {
    font-size: 18px;
    font-weight: 600;
    color: #abafae;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.shared-section-nav a:hover {
    color: #555;
}

.shared-section-nav a.active {
    color: #00D2C2;
    border-bottom-color: #00D2C2;
}

/* ── Right: Search + Profile/Login ── */
.shared-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.shared-search-form {
    display: flex;
    align-items: center;
    background: #f5f7f7;
    border: 1px solid #e0e3e2;
    border-radius: 200px;
    padding: 8px 16px;
    transition: border-color 0.2s;
    flex: 0 1 auto;
    min-width: 0;
}

.shared-search-form:focus-within {
    border-color: #00D2C2;
}

.shared-search-form input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 280px;
    min-width: 60px;
    flex: 1;
    color: #3f4342;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* Figma: search input text turns teal when actively typing/filled */
.shared-search-form input:not(:placeholder-shown) {
    color: #00D2C2;
}

.shared-search-form input::placeholder {
    color: #abafae;
}

.shared-search-form button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 0;
    flex-shrink: 0;
}

.shared-search-form button img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* ── Nav Icons ── */
.shared-header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shared-header-profile {
    display: flex;
    align-items: center;
}

.shared-header-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.shared-header-profile img:hover {
    border-color: #00D2C2;
}

.shared-header-chat {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    color: #8d8d8d;
    transition: color 0.2s;
}
.shared-header-chat:hover {
    color: #3f4342;
}
.shared-header-chat svg {
    opacity: 0.6;
    transition: opacity 0.2s;
}
.shared-header-chat:hover svg {
    opacity: 1;
}

.shared-header-bell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.shared-header-bell img {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.shared-header-bell img:hover {
    opacity: 1;
}

.shared-login-link {
    font-size: 16px;
    font-weight: 600;
    color: #00D2C2 !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.shared-login-link:hover {
    opacity: 0.8;
}

/* ── Shared Footer ── */
.shared-footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 0;
    margin-top: auto;
    font-size: 13px;
    color: #888;
}

.shared-footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: left;
}

.shared-company-info {
    margin-bottom: 12px;
    line-height: 1.8;
}

.shared-company-info p {
    margin: 0;
}

.shared-company-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.shared-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
}

.shared-copyright {
    font-size: 12px;
    color: #bbb;
    margin: 0;
}

.shared-footer-nav {
    display: flex;
    gap: 16px;
}

.shared-footer-nav a {
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.shared-footer-nav a:hover {
    color: #00D2C2;
}

/* ── Notification Dropdown — Figma: right-side card panel ── */
.cnt-notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 280px;
    max-height: 520px;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #eee;
    z-index: 1000;
    padding: 0;
}

.cnt-notification-dropdown.open {
    display: block;
}

.cnt-notification-header {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 18px 12px;
    font-size: 16px;
    font-weight: 700;
    color: #00D2C2;
    border-bottom: none;
}

/* Notification list container */
#shared-notf-list {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* Each notification item — Figma: name+action left, date right */
.cnt-notf-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 36px 10px 18px; /* 右側に × 用のスペース */
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.cnt-notf-item:last-child {
    border-bottom: none;
}

.cnt-notf-item:hover {
    background: #f9fffe;
}

.cnt-notf-item.cnt-notf-unread {
    background: rgba(0, 210, 194, 0.04);
}

/* Dismiss button (×) — 個別通知を既読化して非表示に */
.cnt-notf-dismiss {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #999;
    font-size: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}
.cnt-notf-dismiss:hover {
    background: #f0f0f0;
    color: #e53935;
}

.cnt-notf-body {
    flex: 1;
    min-width: 0;
}

.cnt-notf-action {
    font-size: 13px;
    color: #3F4342;
    margin: 0;
    line-height: 1.4;
}

.cnt-notf-name {
    color: #00D2C2;
    font-weight: 600;
}

.cnt-notf-preview {
    font-size: 12px;
    color: #878787;
    margin: 2px 0 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cnt-notf-date {
    font-size: 12px;
    color: #abafae;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

/* Show more link */
.cnt-notf-showmore {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: #abafae;
    text-decoration: none;
    border-top: 1px solid #f0f0f0;
}

.cnt-notf-showmore:hover {
    color: #00D2C2;
}

.cnt-notification-empty,
.cnt-notf-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 14px;
    color: #abafae;
}

/* ── Notification Badge ── */
.cnt-notf-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    text-align: center;
    padding: 0 4px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .shared-search-form input {
        width: 140px;
    }

    .shared-section-nav {
        gap: 12px;
    }

    .shared-section-nav a {
        font-size: 16px;
    }
}

@media (max-width: 750px) {
    .shared-search-form input {
        width: 100px;
    }

    .shared-section-nav a {
        font-size: 15px;
    }

    .shared-header-right {
        gap: 8px;
    }
}

@media (max-width: 992px) {
    .cnt-notification-dropdown {
        width: 260px;
    }
}

@media (max-width: 743px) {
    .cnt-notification-dropdown {
        position: fixed;
        top: 56px;
        right: 0;
        left: auto;
        width: 300px;
        max-height: calc(100vh - 56px);
        border-radius: 0 0 14px 14px;
    }
}

@media (max-width: 600px) {
    .shared-header {
        padding: 8px 12px;
    }

    .shared-section-nav {
        gap: 8px;
        margin-left: 2px;
    }

    .shared-section-nav a {
        font-size: 12px;
    }

    .shared-header-nav {
        gap: 4px;
    }

    .shared-header-right {
        margin-left: 8px;
        margin-right: -4px;
        gap: 6px;
    }

    .shared-search-form input {
        width: 60px;
        font-size: 12px;
    }

    .shared-search-form {
        padding: 5px 8px;
    }

    .shared-search-form button img {
        width: 14px;
        height: 14px;
    }

    .shared-search-form input::placeholder {
        font-size: 11px;
    }

    .shared-logo {
        display: none;
    }

    .shared-header-profile img {
        width: 26px;
        height: 26px;
    }

    .shared-header-bell img {
        width: 18px;
        height: 18px;
    }

    .shared-header-chat svg {
        width: 18px;
        height: 18px;
    }

    .shared-footer-inner {
        padding: 20px 12px;
    }
}

@media (max-width: 599px) {
    .cnt-notification-dropdown {
        position: fixed;
        width: 100%;
        left: 0;
        right: 0;
        top: 50px;
        border-radius: 0;
    }
}
