/* General Body Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;

    margin-left: 20px;  /* Added to provide spacing between tabs */
}

/* Optional: Prevent left margin on the first link */
.nav-links a:first-child {
    margin-left: 0;
}

.nav-links a:hover {
    color: #007bff;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e0f7fa, #bbdefb);
    color: #333;
    padding: 80px 20px;
    text-align: center;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    margin-bottom: 40px;
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #34495e;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    color: #555;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* Tabs */
.tabs-container {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
}

.tabs {
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid #eee;
}

.tab {
    flex-grow: 1;
    padding: 18px 25px;
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
}

.tab:hover {
    color: #007bff;
}

.tab.active {
    color: #007bff;
    background-color: #eaf6ff;
}

.tab.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #007bff;
}

/* Controls (Search & Stats) */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.stats-container {
    display: flex;
    gap: 25px;
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    justify-content: center;
}

.stats {
    display: flex;
    gap: 25px;
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-item {
    font-size: 0.95em;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: #007bff;
}

.stat-item strong {
    color: #007bff;
    font-weight: 700;
}

/* IPO Table */
.table-container {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
     /* Added for desktop fallback, though mobile will use card view */
}

.ipo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    min-width: 900px; /* Ensure table doesn't get too narrow on desktop */
}
.ipo-table thead th {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}
.ipo-table tbody td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.ipo-table tbody tr:hover {
    background-color: #f1f7ff;
}

.ipo-table tbody tr:last-child td {
    border-bottom: none;
}

.ipo-name {
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ipo-name:hover {
    color: #0056b3;
    text-decoration: underline;
}

.date-range strong {
    color: #333;
}

.price-range {
    font-weight: 500;
    color: #28a745;
}

.subscription-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.subscription-status.high-subscription {
    background-color: #d4edda;
    color: #155724;
}

.subscription-status.medium-subscription {
    background-color: #fff3cd;
    color: #856404;
}

.subscription-status.low-subscription {
    background-color: #f8d7da;
    color: #721c24;
}

.subscription-status.tba-subscription {
    background-color: #e2e6ea;
    color: #495057;
}

.subscription-status:hover {
    opacity: 0.8;
}

.status-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.status-link:hover {
    text-decoration: underline;
}

.ipo-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.ipo-status-upcoming {
    background-color: #cfe2ff;
    color: #084298;
}

.ipo-status-open {
    background-color: #d1e7dd;
    color: #0f5132;
}

.ipo-status-closed {
    background-color: #f8d7da;
    color: #842029;
}

.ipo-status-allotment.pending {
    background-color: #ffecb5;
    color: #664d03;
}

.ipo-status-listed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.docs-column a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.docs-column a:hover {
    text-decoration: underline;
}

.loading,
.empty-state {
    text-align: center;
    padding: 30px;
    color: #6c757d;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state.error-state {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
}

.empty-state.error-state h3 {
    color: #721c24;
}

/* Upcoming IPOs Table Specifics */
#upcomingTable thead th:nth-child(2),
#upcomingTable tbody td:nth-child(2) {
    width: 150px; /* Adjust width for Last Updated column */
}

/* Allotment Status Table Specifics */
#allotmentDescription {
    background-color: #e9f7ef;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    color: #155724;
}

.dashboard-description {
    font-size: 1.1em;
    line-height: 1.8;
}

/* FAQ Section */
.faq-section {
    background-color: #ffffff;
    padding: 60px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 40px;
}

.faq-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background-color: #eaf6ff;
    padding: 18px 25px;
    border: none;
    text-align: left;
    font-size: 1.1em;
    font-weight: 600;
    color: #007bff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #dbeeff;
}

.faq-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    color: #555;
    text-align: left;
}

.faq-answer.active {
    max-height: 300px; /* Adjust as needed */
    padding: 15px 25px 25px 25px;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 50px 20px 20px 20px;
    font-size: 0.95em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.7;
    margin-bottom: 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #007bff;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    text-align: center;
    color: #95a5a6;
}

.footer-bottom p {
    margin: 5px 0;
    font-size: 0.9em;
}

.footer-bottom .disclaimer-text {
    margin-top: 10px;
    font-size: 0.85em;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Make table header sticky */
.ipo-table thead th {
  position: sticky;
  top: 84px;           /* match your sticky .header height (adjust if needed) */
  background: #f8f9fa; /* opaque bg so rows don’t bleed through */
  z-index: 2;          /* above rows but below modals */
}

/* Popup Styles (omitted for brevity, assume they are correct) */
.popup-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Blur effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.popup-content h2 {
    color: #007bff;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.subscription-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.subscription-table-container th,
.subscription-table-container td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.subscription-table-container th {
    background-color: #f2f2f2;
    font-weight: 600;
    color: #333;
}

.subscription-table-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subscription-table-container tr:hover {
    background-color: #f1f7ff;
}

.subscription-table-container td strong {
    color: #007bff;
}

.last-updated-text {
    font-size: 0.9em;
    color: #777;
    text-align: right;
    margin-top: 15px;
}

.popup-content p {
    text-align: center;
    font-size: 1.1em;
    color: #555;
    padding: 20px;
    background-color: #ffe0b2;
    border: 1px solid #ffcc80;
    border-radius: 8px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* --- General Layout Adjustments --- */
    body {
        font-size: 14px;
    }

    .main-content {
        padding: 0 10px;
        margin-bottom: 30px;
    }

    /* --- Header & Navigation (FIXED) --- */
    .header {
        padding: 8px 0; /* Smaller vertical padding */
    }

    .nav-container, .nav {
        padding: 0 10px; /* Less horizontal padding */
        /* Ensure the logo and nav links are on the same line */
        flex-wrap: nowrap;
        overflow-x: hidden;
    }

    .logo {
        font-size: 20px;
        flex-shrink: 0; /* Prevent logo from shrinking */
    }

    .logo img {
        height: 32px; /* Smaller logo height */
    }

    /* Mobile Navigation: Horizontal Scrollable Links (FIXED) */
    .nav-links {
        display: flex; /* Make sure links are visible */
        flex-wrap: nowrap;
        overflow-x: auto; /* Enable horizontal scrolling */
        -webkit-overflow-scrolling: touch;
        margin-left: 10px; /* Space between logo and links */
        padding-bottom: 5px; /* Space for scrollbar */
    }

    .nav-links li {
        margin-left: 15px; /* Reduced spacing */
        flex-shrink: 0; /* Prevent links from shrinking */
    }

    .nav-links a {
        font-size: 0.9em;
        padding: 5px 4;
        margin-left: 0;
    }

    /* Hero Section */
    .hero {
        padding: 40px 15px;
        border-bottom-left-radius: 25px;
        border-bottom-right-radius: 25px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 2.2em;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }

    .hero-description {
        font-size: 1em;
        margin-bottom: 25px;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1em;
    }

    /* Controls (Search & Stats) */
    .controls {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .search-box {
        max-width: 100%; /* Full width search box */
        order: 1; /* Place search box first */
    }

    .stats-container, .stats {
        width: 92%;
        padding: 10px 15px;
        gap: 15px;
        justify-content: space-around; /* Better distribution of stats */
        order: 2; /* Place stats second */
    }

    /* Tabs (Mainboard, SME, etc.) */
    .tabs {
        overflow-x: auto; /* Enable horizontal scrolling for tabs */
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start; /* Align tabs to the left */
        white-space: nowrap; /* Prevent wrapping */
    }

    .tab {
        flex-shrink: 0; /* Prevent tabs from shrinking */
        padding: 12px 15px; /* Smaller padding for tabs */
        font-size: 0.95em;
    }

    /* --- IPO Table: Card View Transformation (FIXED) --- */

    /* Hide the desktop table structure */
    .ipo-table {
        min-width: unset; /* Remove fixed width */
        border-collapse: separate; /* Allow border-radius on rows */
        border-spacing: 0 10px; /* Add space between "cards" */
    }

    .ipo-table thead {
        display: none; /* Hide table headers */
    }

    /* Make table rows look like cards */
    .ipo-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #eee;
        overflow: hidden;
    }

    .ipo-table tbody tr:hover {
        background-color: #ffffff; /* Keep background white on hover */
    }

    /* Transform table cells into block elements */
    @media (max-width: 768px) {
  /* Make label and value appear side by side */
  .ipo-table tbody td {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      text-align: left;
      position: relative;
      padding: 10px 15px;
      border-bottom: 1px solid #f0f0f0;
      gap: 8px; /* Space between label and value */
  }

  .ipo-table tbody td::before {
      content: attr(data-label);
      font-weight: 700;
      color: #333;
      margin-right: 10px;
      min-width: 120px;   /* Adjust as needed; can use a smaller value if your labels are short */
      flex-shrink: 0;
      white-space: nowrap;
      /* Remove display:block, margin-bottom, and position */
  }

  /* Exception for the first cell (main card header/title) */
  .ipo-table tbody tr td:first-child {
      display: block;  /* Make only the first cell a block for header style */
      background-color: #eaf6ff;
      color: #007bff;
      font-size: 1.1em;
      font-weight: 700;
      text-align: left;
      padding: 12px 15px;
      border-bottom: 1px solid #dbeeff;
  }

  .ipo-table tbody tr td:first-child::before {
      content: none; /* No label for the row title */
  }
}
@media (max-width: 768px) {
  /* Fix misalignment for the status tags */
  .ipo-table .subscription-status,
  .ipo-table .ipo-status {
      margin-left: 0 !important;   /* Remove auto margin */
      margin-right: 0 !important;
      align-self: center;          /* Vertically center if height differs */
      display: inline-flex !important; /* Match inline appearance inside flex cell */
  }
}


    .ipo-name {
        font-weight: inherit;
        color: inherit;
    }

    .subscription-status {
        display: block;
        width: fit-content;
        margin-left: auto;
    }

    .ipo-status {
        display: block;
        width: fit-content;
        margin-left: auto;
    }

    /* Sticky header adjustment for mobile */
    .ipo-table thead th {
        top: 48px; /* Adjusted sticky offset for smaller mobile header */
    }

    /* --- Footer Adjustments --- */
    .footer {
        padding: 30px 10px 10px 10px;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }

    .footer-section {
        min-width: 100%;
        text-align: center;
    }

    .footer-section h4::after {
        content: '';
        display: block;
        width: 50px;
        height: 2px;
        background-color: #007bff;
        margin: 10px auto 0;
    }

    .footer-section ul {
        text-align: center;
    }

    .footer-bottom {
        padding-top: 15px;
    }

    .footer-bottom p {
        font-size: 0.85em;
    }

    /* --- FAQ Section --- */
    .faq-section {
        padding: 40px 10px;
    }

    .faq-title {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .faq-question {
        padding: 15px 20px;
        font-size: 1em;
    }

    .faq-answer.active {
        padding: 10px 20px 20px 20px;
    }

    /* --- Popup Adjustments --- */
    .popup-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .close-button {
        top: 5px;
        right: 15px;
        font-size: 24px;
    }

    .popup-content h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .subscription-table-container th,
    .subscription-table-container td {
        padding: 8px;
        font-size: 0.9em;
    }

    .last-updated-text {
        text-align: center;
    }
}
/* End of Mobile Responsiveness Styles */

@media (max-width: 768px) {
  .ipo-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 4px;
  }
}



/* GMP page: breakdown under Est. Listing price */
.est-breakdown {
  display: block;
  font-size: 0.9em;
  color: #6b7280;
  margin-top: 6px;
}
.gmp-table-wrapper { max-width: 1200px; margin: 30px auto 80px; padding: 0 20px; }
