/* ==========================================
   Staking Page Styles
   ========================================== */

/* CSS Variables */
:root {
    /* Colors */
    --c-leading: #10bdc2;
    --c-leading-hover: #50dce0;
    --c-white: #fff;
    --c-black: #000;
    --c-gray: #999;
    --c-gray-light: #fefefe;
    --c-gray-dark: #333;
    --c-red: #f00;
    --c-up: #10c27e;
    --c-down: #e03939;
    --c-background: #f9f9f9;
    --c-background-postsub: #f6f6f6;
    --c-maintext: #4a4a4a;
    --c-subtext: #6e6e6e;
    --c-border: #ddd;

    /* Breakpoints */
    --w-breakpoint: 768px;

    /* Z-index */
    --z-staking-table: 1;
    --z-staking-table-header: 2;
    --z-staking-table-header-col-fix: 3;
    --z-staking-table-col-fix: 2;
  }

  /* Base styles */
  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    background-color: var(--c-background);
    color: #1c1c1c;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  /* Responsive mixins as CSS classes */
  .pc-only {
    display: block;
  }

  .sp-only {
    display: none;
  }

  @media (max-width: 767px) {
    .pc-only {
      display: none;
    }

    .sp-only {
      display: block;
    }
  }

  /* Section Header Styles */
  .SectionHeader {
    margin: 20px 0 5px;
    border-bottom: 3px solid var(--c-leading);
  }

  .SectionHeader.-no-margin {
    margin: 0;
  }

  .SectionHeader.-no-border {
    border: none;
  }

  @media (max-width: 767px) {
    .SectionHeader {
      margin: 0;
      border-bottom-width: 2px;
    }
  }

  .SectionHeader__Inner {
    margin: 0;
  }

  @media (max-width: 767px) {
    .SectionHeader__Inner {
      width: 100%;
      padding: 12px 12px 0;
    }
  }

  .SectionHeader__Heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 21px;
    font-weight: bold;
    margin: 0;
    padding-bottom: 3px;
  }

  @media (max-width: 767px) {
    .SectionHeader__Heading {
      font-size: 15px;
    }
  }

  .SectionHeader__Link {
    color: var(--c-leading);
    text-decoration: none;
  }

  /* Staking Table Styles */
  .StakingTable__Wrapper {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
  }

  @media (max-width: 767px) {
    .StakingTable__Wrapper {
      width: 90%;
      margin: auto;
      max-height: 400px;
    }
  }

  .StakingTable__Wrapper::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
  }

  .StakingTable {
    width: 100%;
    min-width: 800px;
    background-color: var(--c-white);
    border-collapse: collapse;
    border-spacing: 0;
    position: relative;
  }

  .StakingTable thead {
    background-color: var(--c-leading);
    color: var(--c-white);
    vertical-align: middle;
  }

  .StakingTable thead th {
    position: sticky;
    top: 0;
    z-index: var(--z-staking-table-header);
    background-color: var(--c-leading);
  }

  /* Header Cell Styles */
  .StakingTable__TableHeaderCell {
    padding: 8px 8px;
    font-size: 13px;
    line-height: 1;
    color: var(--c-white);
    font-weight: bold;
    background-color: var(--c-leading);
    border-right: none;
    cursor: pointer;
    position: relative;
  }

  .StakingTable__TableHeaderCell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-left: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
  }

  @media (max-width: 767px) {
    .StakingTable__TableHeaderCell.-is-not-fixed-first-column::before {
      border-left: none;
    }
  }

  /* Table Cell Styles */
  .StakingTable__TableCell {
    padding: 3px 8px;
    background-color: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
  }

  .StakingTable__TableCell:last-child {
    border-right: none;
  }

  /* Name Cell Styles */
  .StakingTable__NameHeaderCell {
    padding: 8px 8px;
    font-size: 13px;
    line-height: 1;
    color: #fff;
    background-color: var(--c-leading);
    cursor: pointer;
    position: relative;
  }

  .StakingTable__NameCell {
    width: 200px;
  }

  @media (max-width: 767px) {
    .StakingTable__NameHeaderCell,
    .StakingTable__NameCell {
      width: 150px;
    }
  }

  @media (max-width: 767px) {
    .StakingTable__NameHeaderCell::before {
      border-right: 1px solid rgba(0, 0, 0, 0.12);
    }
  }

  .StakingTable__NameCell {
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
  }

  @media (max-width: 767px) {
    .StakingTable__NameCell {
      position: sticky;
      left: 0;
      z-index: var(--z-staking-table-col-fix);
      border-right: none;
    }

    .StakingTable__NameCell::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-right: 1px solid var(--c-border);
      border-bottom: 1px solid var(--c-border);
    }
  }

  .StakingTable__NameCellContent {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    padding: 8px 8px;
  }

  .StakingTable__IconWrapper {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    flex-basis: 20px;
    min-width: 20px;
    height: 20px;
  }

  .StakingTable__IconWrapper img {
    width: 16px;
    height: 16px;
  }

  .StakingTable__NameWrapper {
    margin-left: 0.5rem;
  }

  .StakingTable__Anchor {
    color: var(--c-leading);
  }

  .StakingTable__AssetName {
    font-weight: bold;
    font-size: 16px;
  }

  @media (max-width: 767px) {
    .StakingTable__AssetName {
      font-size: 14px;
    }
  }

  .StakingTable__AssetSymbol {
    color: var(--c-subtext);
    font-size: 12px;
  }

  .StakingTable__Value {
    text-align: right;
    font-size: 14px;
    padding: 8px;
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
  }

  .StakingTable__Value.-reward .-highlight {
    color: var(--c-up);
  }

  .StakingTable__Value.-remainingStaked .-highlight {
    color: var(--c-down);
  }

  /* 利率が5%以上の場合は緑色 */
  .StakingTable__Value.-high-reward {
    color: var(--c-up);
    font-weight: bold;
  }

  /* 残り募集数が30%未満の場合は赤色 */
  .StakingTable__Value.-low-remaining {
    color: var(--c-down);
    font-weight: bold;
  }

  /* Sortable Header Cell Styles */
  .SortableHeaderCell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }

  .SortableHeaderCell__Label {
    margin-right: 5px;
  }

  .SortableHeaderCell__Icon {
    font-size: 12px;
  }

  /* Post Content Styles */
  .PostContent {
    background-color: white;
    padding: 10px 20px;
    word-wrap: break-word;
  }

  .PostContent__MainContent {
    box-sizing: border-box;
  }

  .PostContent__MainContent div {
    box-sizing: border-box;
  }

  .PostContent__MainContent a {
    color: var(--c-leading);
    word-break: break-all;
    text-decoration: underline;
  }

  .PostContent__MainContent a:hover {
    color: #5fc7ca;
  }

  .PostContent__MainContent p {
    margin: 20px 0;
    line-height: 28px;
  }

  .PostContent__MainContent img {
    margin: 0 auto;
    display: block;
    height: auto;
  }

  .PostContent__MainContent li {
    margin-left: 30px;
  }

  .PostContent__MainContent h2 {
    color: var(--c-white);
    font-size: 23px;
    position: relative;
    padding: 0.5em;
    margin: 30px 0 45px;
    background-color: var(--c-leading);
    font-weight: bold;
  }

  @media (max-width: 767px) {
    .PostContent__MainContent h2 {
      margin: 20px 0 30px;
    }
  }

  .PostContent__MainContent h2 a {
    text-decoration: none;
  }

  .PostContent__MainContent h2 a:hover {
    color: inherit;
  }

  .PostContent__MainContent h2::before {
    position: absolute;
    content: '';
    top: 100%;
    left: 0;
    border-bottom: solid 15px transparent;
    border-right: solid 20px rgb(149, 158, 155);
  }

  .PostContent__MainContent h3 {
    color: #303030;
    font-size: 21px;
    font-weight: 700;
    line-height: 32px;
    padding: 8px 15px;
    border-left: solid 6px var(--c-leading);
    border-radius: 3px;
    background-color: var(--c-background-postsub);
    margin: 20px 0;
  }

  .PostContent__MainContent h3 a {
    text-decoration: none;
  }

  .PostContent__MainContent h4 {
    color: var(--c-leading);
    font-size: 21px;
    font-weight: 700;
    line-height: 28px;
    padding: 8px 0;
    border-bottom: solid 2px var(--c-leading);
    margin: 20px 0;
  }

  @media (max-width: 767px) {
    .PostContent__MainContent img {
      max-width: 100%;
    }
  }

  /* Utilities */
  .flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .flex-justify-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .text-decoration-none {
    text-decoration: none;
  }

  /* Hover effects */
  a:hover {
    opacity: 0.6;
  }

  .StakingTable__TableHeaderCell:hover {
    background-color: #0ea6aa;
  }

  /* Focus styles for accessibility */
  .StakingTable__TableHeaderCell:focus {
    outline: 2px solid var(--c-leading);
    outline-offset: 2px;
  }

  /* ソートヘッダーのスタイル */
  .StakingTable__NameHeaderCell a {
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
  }

  .StakingTable__NameHeaderCell a:hover {
    color: inherit;
    background-color: transparent;
    opacity: 1;
  }

  /* Print styles */
  @media print {
    .StakingTable {
      overflow: visible !important;
    }

    .StakingTable__Inner {
      overflow: visible !important;
      max-height: none !important;
    }
  }