/* ═══════════════════════════════════════════════════════════
   IPO Schedule – Desktop (Redesigned: unified card style)
   ═══════════════════════════════════════════════════════════ */

/* ── Banner ── */
.ipo-schedule-banner {
    width: 1200px;
    height: 300px;
    margin-bottom: 60px;
    border-radius: 12px;
    overflow: hidden;
}

.ipo-schedule-banner > a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.ipo-schedule-banner > a > img {
    height: 100%;
    object-fit: cover;
}

/* ── Title Bar ── */
.ipo-title-wrapper {
    min-width: 1440px;
    background-color: #1f2e45;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipo-title {
    display: block;
    width: 1200px;
    font-weight: 700;
    color: #fff;
    font-size: 24px;
}

/* ── Calendar Section ── */
.ipo-calender {
    margin: 95px auto 0;
    width: 1200px;
    overflow: visible;
}

.ipo-calender-title-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    overflow: visible;
}

.ipo-popup-title-wrapper {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.ipo-popup-title-wrapper > img {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.ipo-calender-title {
    color: #272727;
    font-size: 24px;
    font-weight: 700;
}

/* ── Popup Button (pill) ── */
.ipo-popup-button-wrapper {
    position: relative;
    overflow: visible;
}

.ipo-popup-button {
    line-height: 1;
    display: flex;
    padding: 8px 16px;
    align-items: center;
    border-radius: 50px;
    background: #f4f4f4;
    border: none;
    margin-left: 16px;
    color: #272727;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ipo-popup-button:hover {
    background-color: #eaeaea;
}

.ipo-popup-button > img {
    margin-left: 8px;
}

/* ── Popup (tooltip card) ── */
.ipo-popup {
    position: absolute;
    left: 16px;
    top: 40px;
    z-index: 100;
    display: flex;
    width: 360px;
    padding: 20px 20px 24px 20px;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 12px;
    border: 1px solid #e9e9e9;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    word-break: keep-all;
}

.ipo-popup-title {
    margin-bottom: 8px;
    color: #272727;
    font-size: 14px;
    font-weight: 700;
}

.ipo-popup > ol > li:last-child > p {
    margin-bottom: 0;
}

.ipo-popup-description {
    margin: 4px 0 12px;
    color: #272727;
    font-size: 14px;
    line-height: 22px;
}

.ipo-popup-divider {
    margin-bottom: 12px;
    width: 100%;
    height: 1px;
    background: #ececec;
}

.ipo-popup > ol {
    list-style: none;
}

.ipo-popup-content-list {
    margin-bottom: 8px;
    padding: 8px 12px 8px 30px;
    list-style-type: disc;
    border-radius: 8px;
    background: #f4f4f4;
    font-size: 12px;
    line-height: 20px;
}

.ipo-popup-content-list > li::marker {
    font-size: 10px;
}

/* ── Dividers ── */
.divider {
    width: 100%;
    height: 2px;
    background-color: #272727;
}

.thin {
    height: 1px;
}

.grey {
    background-color: #ececec;
}

/* ── Calendar Sub-headings ── */
.ipo-calender > h3 {
    margin-top: 40px;
    margin-bottom: 16px;
    color: #272727;
    font-size: 18px;
    font-weight: 700;
}

/* ── IPO Item Cards ── */
.ipo-item-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ipo-item-list.empty {
    display: block;
}

.ipo-item {
    margin-bottom: 16px;
    width: 592px;
    padding: 28px;
    box-sizing: border-box;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.ipo-item:hover {
    border-color: #d8d8d8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ipo-item:nth-child(2n -1) {
    margin-right: 16px;
}

.ipo-item h4 {
    margin-bottom: 16px;
    color: #272727;
    font-size: 18px;
    font-weight: 700;
}

.stock-detail-link span:first-child {
    text-decoration: underline;
}

.dday {
    margin-left: 2px;
    color: #e02b35;
    font-size: 14px;
    font-weight: 700;
}

.ipo-item > ul {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ipo-item > ul > li {
    color: #272727;
    font-size: 14px;
}

.ipo-item > ul > li > span:first-child {
    color: #808080;
}

/* ── More Button (calendar section) ── */
.more-button {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    width: 196px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    background: #fff;
    color: #808080;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.more-button:hover {
    background-color: #fafafa;
    border-color: #d0d0d0;
}

/* ── Empty States ── */
.empty-subscription-plan,
.empty-listing-plan {
    position: relative;
    width: 100%;
    display: flex;
    height: 164px;
    justify-content: center;
    align-items: center;
    color: #d3d3d3;
    font-size: 14px;
    border-radius: 12px;
    background: #fafafa;
}

/* ═══════════════════════════════════════════════════════════
   IPO Schedule Table Section
   ═══════════════════════════════════════════════════════════ */

.ipo-schedule {
    margin: 80px auto 200px;
    width: 1200px;
    overflow: visible;
}

.ipo-schedule-title {
    color: #272727;
    font-size: 24px;
    font-weight: 700;
}

/* ── Tab Menu (pill style, matches promotions) ── */
.ipo-schedule-menu {
    border-top: none;
    border-bottom: none;
    margin-top: 16px;
    display: flex;
    overflow: visible;
    background-color: #f4f4f4;
    border-radius: 12px;
    padding: 4px;
    box-sizing: border-box;
}

.ipo-schedule-menu > li {
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible;
}

.ipo-schedule-menu .menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    padding: 9px 10px 8px 10px;
    height: 48px;
    box-sizing: border-box;
    flex: 1 0 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.menu-item:hover {
    color: #555;
}

.menu-item > img {
    margin-left: 4px;
    filter: invert(68%) sepia(4%) saturate(8%) hue-rotate(358deg)
        brightness(101%) contrast(81%);
}

/* ── Semi-popup (info tooltip from tab) ── */
.ipo-semi-popup {
    word-break: keep-all;
    position: absolute;
    top: 50px;
    left: 62px;
    width: 360px;
    padding: 20px 20px 24px 20px;
    border-radius: 12px;
    border: 1px solid #e9e9e9;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 999;
}

.ipo-semi-popup-content-list {
    padding-left: 10px;
    list-style: disc;
    color: #272727;
    font-size: 12px;
    line-height: 20px;
}

.ipo-semi-popup-content-list > li::marker {
    font-size: 10px;
}

/* ── Step Arrow ── */
.next-icon {
    padding: 0 4px;
    color: #c0c0c0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

/* ── Selected Tab ── */
.ipo-schedule-menu .menu-item.selected {
    background: #1f2e45;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.selected > img {
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg)
        brightness(200%) contrast(100%);
}

/* ── Table Sub-titles ── */
.ipo-schedule-table-title {
    margin: 40px 0 16px;
    color: #272727;
    font-size: 18px;
    font-weight: 700;
}

/* ── Table ── */
.ipo-table {
    width: 100%;
    color: #272727;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    word-break: keep-all;
}

.ipo-table-header {
    font-size: 12px;
    height: 40px;
    background-color: #f7f8fa;
    border-bottom: 1px solid #ececec;
}

.ipo-table-row {
    color: #272727;
    font-size: 14px;
    font-weight: 700;
    min-height: 60px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.ipo-table-row:last-child {
    border-bottom: none;
}

.ipo-table-row:hover {
    background-color: #fafbfc;
}

.ipo-table-header,
.ipo-table-row {
    display: flex;
    align-items: center;
    padding-right: 16px;
    box-sizing: border-box;
}

.ipo-table-row > td {
    word-break: break-all;
    font-size: 14px;
    line-height: 20px;
    color: #272727;
    padding: 12px 0;
}

.ipo-table-header > th:first-child,
.ipo-table-row > td:first-child {
    flex: 100 0 0;
    padding-left: 28px;
    text-align: left;
}

.ipo-table-row > td:first-child {
    font-size: 16px;
}

.ipo-table-header > th:nth-child(2),
.ipo-table-row > td:nth-child(2) {
    text-align: left;
    flex: 55 0 0;
}

.ipo-table-header > th:nth-child(3),
.ipo-table-row > td:nth-child(3) {
    text-align: left;
    flex: 55 0 0;
}

.ipo-table-header > th:nth-child(4),
.ipo-table-row > td:nth-child(4) {
    text-align: left;
    flex: 47 0 0;
}

.ipo-table-header > th:nth-child(5),
.ipo-table-row > td:nth-child(5) {
    text-align: left;
    flex: 43 0 0;
}

/* ── Table cell weight overrides ── */
.request-company-row > td:nth-child(4),
.request-company-row > td:nth-child(5) {
    font-weight: normal;
}

.approval-company-row > td:nth-child(4),
.approval-company-row > td:nth-child(5) {
    font-weight: normal;
}

.registration-statement-row > td:nth-child(2),
.registration-statement-row-header > th:nth-child(2) {
    font-weight: normal;
}

.registration-statement-row > td:nth-child(5) {
    font-weight: normal;
}

.demand-forecast-row > td:nth-child(2),
.demand-forecast-row-header > th:nth-child(2) {
    font-weight: normal;
}

.demand-forecast-row > td:nth-child(5) {
    font-weight: normal;
}

.public-offering-row > td:nth-child(5) {
    font-weight: normal;
}

.listing-row > td:nth-child(4),
.listing-row > td:nth-child(5) {
    font-weight: normal;
}

/* ═══════════════════════════════════════════════════════════
   Utility Classes (preserve existing JS behavior)
   ═══════════════════════════════════════════════════════════ */

.invisible {
    width: 0px;
    height: 0px;
    padding: 0;
    margin: 0;
    border: none;
    box-sizing: border-box;
    overflow: hidden;
    visibility: hidden;
}

.ipo-hidden {
    display: none;
}

.ipo-more-button {
    display: block;
    margin: 20px auto;
    padding: 10px 28px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    font-size: 13px;
    color: #808080;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.ipo-more-button:hover {
    background-color: #fafafa;
    border-color: #d0d0d0;
}

.none {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   Monthly Calendar View
   ═══════════════════════════════════════════════════════════ */

/* ── Top 2-column layout ── */
.ipo-top-layout {
    display: flex;
    gap: 24px;
    margin: 30px 0 50px;
    align-items: flex-start;
}

.ipo-calendar-view {
    width: 55%;
    flex-shrink: 0;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    background: #fff;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-month-title {
    font-size: 18px;
    font-weight: 700;
    color: #272727;
}

.calendar-prev,
.calendar-next {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    color: #272727;
    transition: background-color 0.15s;
}

.calendar-prev:hover,
.calendar-next:hover {
    background: #f4f4f4;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    color: #808080;
    font-size: 13px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ececec;
}

.calendar-grid {
    /* Week-based layout: no grid here, weeks are stacked */
}

/* ── Week row ── */
.calendar-week {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    min-height: 70px;
    border-bottom: 1px solid #f5f5f5;
}

/* ── Day number cell ── */
.calendar-day-num {
    padding: 6px 8px 2px;
    font-size: 13px;
    font-weight: 500;
    color: #272727;
    z-index: 1;
}

.calendar-day-num.other-month {
    opacity: 0.3;
}

.calendar-day-num.today {
    background: #f0f4ff;
    border-radius: 8px 8px 0 0;
}


/* ── Single-event badges inside day-num ── */
.calendar-day-num .calendar-badges {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.calendar-badge {
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-badge-subscription { background-color: #f8d0d3; color: #b71c2a; }
.calendar-badge-forecast { background-color: #d4e4fd; color: #1a5cc8; }
.calendar-badge-listing { background-color: #d0f0da; color: #0a8a2e; }
.calendar-badge-request { background-color: #fde8c8; color: #b37a12; }
.calendar-badge-approval { background-color: #e8ddf8; color: #6b3fbd; }
.calendar-badge-report { background-color: #e5e5e5; color: #555; }
.calendar-badge-offering { background-color: #f8d0d3; color: #b71c2a; }

/* ── Event rows area (range bars) ── */
.calendar-event-rows {
    grid-column: 1 / -1;
    position: relative;
    min-height: 4px;
    padding: 2px 0 4px;
}

/* ── Range bar ── */
.calendar-bar {
    position: absolute;
    height: 18px;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 500;
    line-height: 18px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.15s;
    box-sizing: border-box;
}

.calendar-bar:hover {
    opacity: 0.85;
}

.calendar-bar.continues-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.calendar-bar.continues-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-bar-subscription { background-color: #f8d0d3; color: #b71c2a; }
.calendar-bar-forecast { background-color: #d4e4fd; color: #1a5cc8; }
.calendar-bar-listing { background-color: #d0f0da; color: #0a8a2e; }
.calendar-bar-request { background-color: #fde8c8; color: #b37a12; }
.calendar-bar-approval { background-color: #e8ddf8; color: #6b3fbd; }
.calendar-bar-report { background-color: #e5e5e5; color: #555; }
.calendar-bar-offering { background-color: #f8d0d3; color: #b71c2a; }

/* ── Sidebar ── */
.ipo-sidebar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ipo-sidebar-section {
    padding: 0;
    background: #fff;
}

.ipo-sidebar-section > h3 {
    margin: 0 0 16px;
    color: #272727;
    font-size: 16px;
    font-weight: 700;
}

.ipo-sidebar .ipo-item {
    width: 100%;
    padding: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.ipo-sidebar .ipo-item h4 {
    font-size: 13px;
    margin-bottom: 8px;
}

.ipo-sidebar .ipo-item > ul {
    grid-template-columns: 1fr;
    gap: 6px;
}

.ipo-sidebar .ipo-item > ul > li {
    font-size: 13px;
}

.ipo-sidebar .empty-subscription-plan,
.ipo-sidebar .empty-listing-plan {
    height: 100px;
    font-size: 13px;
}

.ipo-sidebar .ipo-item.invisible {
    display: none;
}

.ipo-sidebar .more-button {
    margin-top: 4px;
    width: 100%;
    height: 36px;
    font-size: 12px;
}

/* ── Legend ── */
.calendar-legend {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ececec;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    font-size: 12px;
    color: #808080;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.legend-item:hover {
    color: #272727;
}

.legend-item.selected {
    color: #272727;
    font-weight: 700;
}

.legend-dot {
    width: 20px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    transition: opacity 0.15s, transform 0.15s;
}

.legend-item.selected .legend-dot {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.legend-subscription { background-color: #f8d0d3; }
.legend-forecast { background-color: #d4e4fd; }
.legend-listing { background-color: #d0f0da; }
.legend-request { background-color: #fde8c8; }
.legend-approval { background-color: #e8ddf8; }

/* ── Legend filter: dim non-active bars/badges ── */
.ipo-calendar-view[data-active-filter] .calendar-bar,
.ipo-calendar-view[data-active-filter] .calendar-badge {
    opacity: 0.2;
    transition: opacity 0.2s;
}

.ipo-calendar-view[data-active-filter="subscription"] .calendar-bar-subscription,
.ipo-calendar-view[data-active-filter="subscription"] .calendar-badge-subscription,
.ipo-calendar-view[data-active-filter="forecast"] .calendar-bar-forecast,
.ipo-calendar-view[data-active-filter="forecast"] .calendar-badge-forecast,
.ipo-calendar-view[data-active-filter="listing"] .calendar-bar-listing,
.ipo-calendar-view[data-active-filter="listing"] .calendar-badge-listing,
.ipo-calendar-view[data-active-filter="request"] .calendar-bar-request,
.ipo-calendar-view[data-active-filter="request"] .calendar-badge-request,
.ipo-calendar-view[data-active-filter="approval"] .calendar-bar-approval,
.ipo-calendar-view[data-active-filter="approval"] .calendar-badge-approval {
    opacity: 1;
}

.ipo-calendar-view[data-active-filter] .legend-item:not(.selected) .legend-dot {
    opacity: 0.35;
}
