.comic-reader-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  box-sizing: border-box;
  background: #1a1a1a;
  color: #ffffff;

  &:focus {
    outline: none;
  }

  .navigation {
    flex-shrink: 0;
    width: 100%;
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-bottom: 1px solid #404040;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    min-width: 0;

    .goto-page-controls {
      flex: 0 0 auto;
      order: 1;
      min-width: fit-content;

      .input-group {
        display: flex;
        align-items: center;
        gap: 0.125rem;
        background: rgba(51, 51, 51, 0.9);
        border-radius: 4px;
        padding: 1px;
        border: 1px solid #555;

        .page-input {
          width: 55px;
          padding: 4px 6px;
          border: none;
          border-radius: 3px;
          background: #404040;
          color: #ffffff;
          font-size: 12px;
          text-align: center;
          transition: all 0.2s ease;

          &:focus {
            outline: none;
            background: #4a4a4a;
            box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.5);
          }

          &::placeholder {
            color: #999;
          }
        }

        .go-button {
          padding: 4px 8px;
          background: #4a90e2;
          color: white;
          border: none;
          border-radius: 3px;
          font-size: 12px;
          font-weight: 500;
          cursor: pointer;
          transition: all 0.2s ease;

          &:hover:not(:disabled) {
            background: #357abd;
          }

          &:disabled {
            background: #666;
            cursor: not-allowed;
            opacity: 0.6;
          }
        }
      }
    }

    .page-controls {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
      order: 2;
      min-width: 0;

      .nav-button {
        width: 24px;
        height: 28px;
        border: 1px solid #555;
        background: rgba(51, 51, 51, 0.9);
        color: #ffffff;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;

        span {
          font-size: 11px;
          font-weight: bold;
        }

        &:hover:not(:disabled) {
          background: #4a4a4a;
          border-color: #666;
        }

        &:disabled {
          background: #2a2a2a;
          color: #666;
          cursor: not-allowed;
          border-color: #333;
        }
      }

      .page-info {
        margin: 0 0.5rem;
        padding: 2px 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        font-weight: 500;
        font-size: 12px;
        min-width: 80px;
        text-align: center;

        .current-page {
          color: #4a90e2;
          font-weight: 600;
        }

        .page-separator {
          color: #4a90e2;
          font-weight: 600;
        }

        .total-pages {
          color: #ccc;
        }
      }
    }

    .spread-controls {
      flex: 0 0 auto;
      display: flex;
      gap: 0.25rem;
      order: 3;
      min-width: fit-content;

      .view-button {
        width: 28px;
        height: 28px;
        border: 1px solid #555;
        background: rgba(51, 51, 51, 0.9);
        color: #ffffff;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;

        span {
          font-size: 13px;
        }

        &:hover {
          background: #4a4a4a;
          border-color: #666;
        }
      }
    }
  }

  .image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0.5rem;
    background: #0f0f0f;
    min-height: 0;

    &.bg-black {
      background: #000000;
    }

    &.bg-gray {
      background: #0f0f0f;
    }

    &.bg-white {
      background: #ffffff;
    }

    .pages-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 1rem;
      height: 100%;
      width: 100%;
    }

    &.two-page-view {
      .page-image {
        max-width: calc(50% - 0.5rem);
        max-height: 100%;
      }
    }

    &:not(.two-page-view) {
      .page-image {
        max-width: 100%;
        max-height: 100%;
      }
    }

    .page-image {
      height: auto;
      width: auto;
      object-fit: contain;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
      border-radius: 4px;
      transition: transform 0.2s ease;

      &:hover {
        transform: scale(1.02);
      }
    }

    .no-pages {
      text-align: center;
      color: #999;
      font-size: 18px;
    }

    .loading-container {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 1.5rem;
      text-align: center;

      .loading-text {
        color: #ccc;
        font-size: 16px;
        max-width: 400px;
        line-height: 1.5;
        margin: 0;
      }
    }
  }
}
